From 4697376f990fdfe048b1978aaf64205da826f412 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 15 Apr 2016 17:43:17 +0200 Subject: [PATCH] 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. --- src/devices/nm-device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 70aa2a1485..1c6612df8f 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -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);