summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-04-15 17:43:17 +0200
committerThomas Haller <thaller@redhat.com>2016-04-15 18:09:48 +0200
commit4697376f990fdfe048b1978aaf64205da826f412 (patch)
treee3318a84931e1dfeaf017e814b22c957ccc5105a
parentb2f794fe1e9adc5e9e6a1b55769169d1e2abac28 (diff)
downloadNetworkManager-4697376f990fdfe048b1978aaf64205da826f412.tar.gz
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.
-rw-r--r--src/devices/nm-device.c3
1 files changed, 3 insertions, 0 deletions
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);