summaryrefslogtreecommitdiff
path: root/src/devices/nm-device.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-11-20 13:33:15 +0100
committerThomas Haller <thaller@redhat.com>2015-11-20 15:08:01 +0100
commitc2831875e3a2cf046f8a3b42a971172319c50e99 (patch)
tree485cf43dfce1ea032e3f4b3f3805d3bd2d69593d /src/devices/nm-device.c
parent661ce499737735d8bbfa1fce41171596c8a27bf2 (diff)
downloadNetworkManager-c2831875e3a2cf046f8a3b42a971172319c50e99.tar.gz
default-route: fix deleting default-route when disconnecting device (bgo #757587)
When deconfiguring a device, we must also explicitly clear the default-route -- unless the device was assumed. This can easily reproduced by disconnecting the cable from the wired connection that has the default rout. Prevously, the default-route was not cleared and lingered around. https://bugzilla.gnome.org/show_bug.cgi?id=757587
Diffstat (limited to 'src/devices/nm-device.c')
-rw-r--r--src/devices/nm-device.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 0f7f25793e..1ca9c410ef 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -8676,18 +8676,25 @@ _cleanup_generic_post (NMDevice *self, CleanupType cleanup_type)
NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE;
priv->default_route.v4_has = FALSE;
- priv->default_route.v4_is_assumed = TRUE;
priv->default_route.v6_has = FALSE;
+
+ if (cleanup_type == CLEANUP_TYPE_DECONFIGURE) {
+ priv->default_route.v4_is_assumed = FALSE;
+ priv->default_route.v6_is_assumed = FALSE;
+ nm_default_route_manager_ip4_update_default_route (nm_default_route_manager_get (), self);
+ nm_default_route_manager_ip6_update_default_route (nm_default_route_manager_get (), self);
+ }
+
+ priv->default_route.v4_is_assumed = TRUE;
priv->default_route.v6_is_assumed = TRUE;
+ nm_default_route_manager_ip4_update_default_route (nm_default_route_manager_get (), self);
+ nm_default_route_manager_ip6_update_default_route (nm_default_route_manager_get (), self);
priv->v4_commit_first_time = TRUE;
priv->v6_commit_first_time = TRUE;
priv->linklocal6_dad_counter = 0;
- nm_default_route_manager_ip4_update_default_route (nm_default_route_manager_get (), self);
- nm_default_route_manager_ip6_update_default_route (nm_default_route_manager_get (), self);
-
/* Clean up IP configs; this does not actually deconfigure the
* interface; the caller must flush routes and addresses explicitly.
*/