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:
Lubomir Rintel 2018-08-13 16:14:02 +02:00
parent 8c8e712d87
commit ee6b737c53

View file

@ -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