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-19 22:55:32 +0100
commit825885d5b12300ada94826e75de254702b730e30 (patch)
tree1cd6de7731d348b2985b0ce7077e908830631f83
parenta43ed6cb80546c03d117dac13916bdbd15709ebb (diff)
downloadNetworkManager-825885d5b12300ada94826e75de254702b730e30.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 08fbdadb31..9ebf138e92 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;
}