diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2018-09-28 15:22:03 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2018-10-15 14:05:23 +0200 |
commit | 81aa1a3bb3e51bf6af86a656ebcab083b6225f18 (patch) | |
tree | b75f908383f55a99c1dc30799ab34a7f9efa17d7 | |
parent | 54064144d4956eb127b2193a0be682760fc94a1e (diff) | |
download | NetworkManager-81aa1a3bb3e51bf6af86a656ebcab083b6225f18.tar.gz |
dhcp: reset @was_active on cleanup
The @was_active flag indicates that we started DHCP on an assumed
connection. The idea is that if DHCP succeeded before, any failure
must be treated like a renewal failure (and so it should start a grace
period) rather than a failure in getting an initial lease (which fails
the IP method).
When we clean up the DHCP instance, the flag must be reset to FALSE,
otherwise it will be potentially considered for other connections.
-rw-r--r-- | src/devices/nm-device.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 8de4db55d8..a5b34cf3c5 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -7028,6 +7028,7 @@ dhcp4_cleanup (NMDevice *self, CleanupType cleanup_type, gboolean release) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + priv->dhcp4.was_active = FALSE; nm_clear_g_source (&priv->dhcp4.grace_id); g_clear_pointer (&priv->dhcp4.pac_url, g_free); g_clear_pointer (&priv->dhcp4.root_path, g_free); @@ -7986,6 +7987,7 @@ dhcp6_cleanup (NMDevice *self, CleanupType cleanup_type, gboolean release) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + priv->dhcp6.was_active = FALSE; priv->dhcp6.mode = NM_NDISC_DHCP_LEVEL_NONE; applied_config_clear (&priv->dhcp6.ip6_config); g_clear_pointer (&priv->dhcp6.event_id, g_free); |