From 58c501eda5c41cfecd117246b234f98f0778b44e 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. (cherry picked from commit 4697376f990fdfe048b1978aaf64205da826f412) --- 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 06920a6194..f6e0f76139 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -10025,6 +10025,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);