summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-11-10 15:11:53 +0100
committerThomas Haller <thaller@redhat.com>2014-11-11 12:21:37 +0100
commitffa1367eaed25c0b4dbeb1cbaaa480f60748f404 (patch)
tree9d2e8c483222b7cb386b36cae3e264d2530b9f77
parentb68f643d12774b9bcf0ee77b5ca75d74614e453f (diff)
downloadNetworkManager-ffa1367eaed25c0b4dbeb1cbaaa480f60748f404.tar.gz
policy: minor fix when having multiple default routes with metric MAXUINT32
The case of having a metric MAXUINT32 is special, because in face of multiple default routes with the same metric, NMDefaultRouteManager cannot reduce the effective metric (because there is no lower priority value). This case works already correct, just when adding such a default route, ensure that we add it to the *first* entry. Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--src/nm-default-route-manager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nm-default-route-manager.c b/src/nm-default-route-manager.c
index c265bb1d57..72577d133d 100644
--- a/src/nm-default-route-manager.c
+++ b/src/nm-default-route-manager.c
@@ -161,7 +161,8 @@ _platform_route_sync_add (const VTableIP *vtable, NMDefaultRouteManager *self, g
if (e->synced) {
g_assert (!entry || metric == G_MAXUINT32);
- entry = e;
+ if (!entry)
+ entry = e;
} else
has_unsynced_entry = TRUE;
}