mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 23:30:18 +01:00
device: don't leave dhclient running upon device removal
Leaving processes behind is a no-no for early boot, but probably a wrong
thing to do in any other cases either.
(cherry picked from commit 47b877a7a6)
This commit is contained in:
parent
8c8e712d87
commit
ee6b737c53
1 changed files with 9 additions and 5 deletions
|
|
@ -5060,11 +5060,15 @@ nm_device_removed (NMDevice *self, gboolean unconfigure_ip_config)
|
|||
nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
}
|
||||
|
||||
if (!unconfigure_ip_config)
|
||||
return;
|
||||
|
||||
nm_device_set_ip_config (self, AF_INET, NULL, FALSE, NULL);
|
||||
nm_device_set_ip_config (self, AF_INET6, NULL, FALSE, NULL);
|
||||
if (unconfigure_ip_config) {
|
||||
nm_device_set_ip_config (self, AF_INET, NULL, FALSE, NULL);
|
||||
nm_device_set_ip_config (self, AF_INET6, NULL, FALSE, NULL);
|
||||
} else {
|
||||
if (priv->dhcp4.client)
|
||||
nm_dhcp_client_stop (priv->dhcp4.client, FALSE);
|
||||
if (priv->dhcp6.client)
|
||||
nm_dhcp_client_stop (priv->dhcp6.client, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue