mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 05:40:15 +01:00
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
(cherry picked from commit c2831875e3)
This commit is contained in:
parent
c8d688874f
commit
0178baea2c
1 changed files with 11 additions and 4 deletions
|
|
@ -8081,16 +8081,23 @@ _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;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue