diff options
author | Dan Williams <dcbw@redhat.com> | 2014-05-30 17:09:10 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-07-22 14:39:18 -0500 |
commit | a7a84d7f766db8d5304fdf15c3c511e4343df086 (patch) | |
tree | d6e519cfc0a6ae7545266e6e52b1240fa4e4b62f /src/devices/nm-device.c | |
parent | 9568ae52e4f8747b3773a8fd27bd03df5240fd4d (diff) | |
download | NetworkManager-a7a84d7f766db8d5304fdf15c3c511e4343df086.tar.gz |
core: consolidate DHCP client termination in dhcp[4|6]_fail()
DHCP failure should just clean up the client in all cases. This
also has the benefit of removing the signal handler for the DHCP
client's state-change signal before telling the client to terminate,
which will simplify some DHCP code later.
Diffstat (limited to 'src/devices/nm-device.c')
-rw-r--r-- | src/devices/nm-device.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 6ca17b2f86..0afdc68a29 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -2682,8 +2682,7 @@ dhcp4_fail (NMDevice *device, gboolean timeout) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); - nm_dhcp4_config_reset (priv->dhcp4_config); - + dhcp4_cleanup (device, TRUE, FALSE); if (timeout || (priv->ip4_state == IP_CONF)) nm_device_activate_schedule_ip4_config_timeout (device); else if (priv->ip4_state == IP_FAIL) @@ -2731,7 +2730,6 @@ dhcp4_state_changed (NMDHCPClient *client, break; case NM_DHCP_STATE_TIMEOUT: - nm_dhcp_client_stop (client, FALSE); dhcp4_fail (device, TRUE); break; case NM_DHCP_STATE_DONE: @@ -3109,8 +3107,7 @@ dhcp6_fail (NMDevice *device, gboolean timeout) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); - nm_dhcp6_config_reset (priv->dhcp6_config); - + dhcp6_cleanup (device, TRUE, FALSE); if (timeout || (priv->ip6_state == IP_CONF)) nm_device_activate_schedule_ip6_config_timeout (device); else if (priv->ip6_state == IP_FAIL) @@ -3122,16 +3119,11 @@ dhcp6_timeout (NMDevice *self, NMDHCPClient *client) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - nm_dhcp_client_stop (client, FALSE); if (priv->dhcp6_mode == NM_RDISC_DHCP_LEVEL_MANAGED) dhcp6_fail (self, TRUE); else { /* not a hard failure; just live with the RA info */ - nm_dhcp6_config_reset (priv->dhcp6_config); - if (priv->dhcp6_ip6_config) - g_object_unref (priv->dhcp6_ip6_config); - priv->dhcp6_ip6_config = NULL; - + dhcp6_cleanup (self, TRUE, FALSE); if (priv->ip6_state == IP_CONF) nm_device_activate_schedule_ip6_config_result (self); } |