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 17:37:27 +0100
commitb86910cd5c61e72399dba13b6a9d4e77d56c2792 (patch)
tree89249e8e7bfad23cf1270f1fe322443a0983002c
parentd9343c61efc7eb21dd73a888c14849b3cc6dad38 (diff)
downloadNetworkManager-b86910cd5c61e72399dba13b6a9d4e77d56c2792.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;
}