device: fix preserving the default-route during _cleanup_generic_post()

When we want to preserve the default-route on cleanup, we must first
set it to assumed, before clearing it. Otherwise, NMDefaultRouteManager's
update() will delete the default route.

This is the oposite of the deconfigure case, where we first set it to
!has && !assumed, to force the route-manager to delete the route.
This commit is contained in:
Thomas Haller 2016-04-15 17:43:17 +02:00
parent b2f794fe1e
commit 4697376f99

View file

@ -10067,6 +10067,9 @@ _cleanup_generic_post (NMDevice *self, CleanupType cleanup_type)
if (cleanup_type == CLEANUP_TYPE_DECONFIGURE) {
_update_default_route (self, AF_INET, FALSE, FALSE);
_update_default_route (self, AF_INET6, FALSE, FALSE);
} else {
_update_default_route (self, AF_INET, priv->default_route.v4_has, TRUE);
_update_default_route (self, AF_INET6, priv->default_route.v6_has, TRUE);
}
_update_default_route (self, AF_INET, FALSE, TRUE);
_update_default_route (self, AF_INET6, FALSE, TRUE);