diff options
author | Scott Shambarger <scott-gnome@shambarger.net> | 2014-01-06 16:01:22 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-01-06 16:07:57 -0600 |
commit | a30030b82b158a1cc7784391c9a97ae8ea81e497 (patch) | |
tree | 316a84bdebaa734a38d97bccaf8550549c0f0079 | |
parent | 691422a460166cbe5eb6fe37258fecd2b2c101cf (diff) | |
download | NetworkManager-a30030b82b158a1cc7784391c9a97ae8ea81e497.tar.gz |
core: fix stale DHCPv4 information for dispatcher lease-change events (bgo #721002)
dhcp4_lease_change() needs to be called *after* updating the DHCP config
object to ensure that the dispatcher gets the new values.
-rw-r--r-- | src/devices/nm-device.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 61bb2aafa1..55b4ff8ebe 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -2629,18 +2629,19 @@ dhcp4_state_changed (NMDHCPClient *client, break; } - if (priv->ip4_state == IP_CONF) - nm_device_activate_schedule_ip4_config_result (device, config); - else if (priv->ip4_state == IP_DONE) - dhcp4_lease_change (device, config); - g_object_unref (config); - /* Update the DHCP4 config object with new DHCP options */ nm_dhcp4_config_reset (priv->dhcp4_config); nm_dhcp_client_foreach_option (priv->dhcp4_client, dhcp4_add_option_cb, priv->dhcp4_config); g_object_notify (G_OBJECT (device), NM_DEVICE_DHCP4_CONFIG); + + if (priv->ip4_state == IP_CONF) + nm_device_activate_schedule_ip4_config_result (device, config); + else if (priv->ip4_state == IP_DONE) + dhcp4_lease_change (device, config); + g_object_unref (config); + break; case DHC_TIMEOUT: /* timed out contacting DHCP server */ dhcp4_fail (device, TRUE); |