diff options
author | Thomas Haller <thaller@redhat.com> | 2016-04-15 17:43:17 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-04-15 18:09:48 +0200 |
commit | 4697376f990fdfe048b1978aaf64205da826f412 (patch) | |
tree | e3318a84931e1dfeaf017e814b22c957ccc5105a | |
parent | b2f794fe1e9adc5e9e6a1b55769169d1e2abac28 (diff) | |
download | NetworkManager-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.c | 3 |
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); |