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>
This commit is contained in:
Thomas Haller 2014-11-10 15:11:53 +01:00
parent a43ed6cb80
commit 825885d5b1

View file

@ -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;
}