summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2021-03-31 15:25:38 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2021-04-14 11:54:16 +0200
commit4784c7dccda24a84c0a154d38fa59feb2443cc59 (patch)
tree0606a8e3fdf86e66998dd8917c80a4af1278f14f
parentb9e6b84cb90c5beeb73d76731c0b7701b21118a9 (diff)
downloadNetworkManager-bg/dhcp-stop.tar.gz
dhcp: set TERMINATED state when the client is stoppedbg/dhcp-stop
NM_DHCP_STATE_DONE is for when the client reports that it is shutting down. If we manually stop it, we should set the TERMINATED state, so that NMDevice doesn't start a grace period waiting for a renewal. This fixes the: device (enp1s0): DHCPv4: trying to acquire a new lease within 90 seconds message printed when NM is shutting down. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/802
-rw-r--r--src/core/dhcp/nm-dhcp-client.c2
-rw-r--r--src/core/dhcp/nm-dhcp-client.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/core/dhcp/nm-dhcp-client.c b/src/core/dhcp/nm-dhcp-client.c
index c128095aba..6c5305e170 100644
--- a/src/core/dhcp/nm-dhcp-client.c
+++ b/src/core/dhcp/nm-dhcp-client.c
@@ -749,7 +749,7 @@ nm_dhcp_client_stop(NMDhcpClient *self, gboolean release)
_LOGI("canceled DHCP transaction");
nm_assert(priv->pid == -1);
- nm_dhcp_client_set_state(self, NM_DHCP_STATE_DONE, NULL, NULL);
+ nm_dhcp_client_set_state(self, NM_DHCP_STATE_TERMINATED, NULL, NULL);
}
/*****************************************************************************/
diff --git a/src/core/dhcp/nm-dhcp-client.h b/src/core/dhcp/nm-dhcp-client.h
index 72ab477dfb..af3406ccea 100644
--- a/src/core/dhcp/nm-dhcp-client.h
+++ b/src/core/dhcp/nm-dhcp-client.h
@@ -51,7 +51,7 @@ typedef enum {
NM_DHCP_STATE_BOUND, /* new lease */
NM_DHCP_STATE_EXTENDED, /* lease extended */
NM_DHCP_STATE_TIMEOUT, /* timed out contacting server */
- NM_DHCP_STATE_DONE, /* client quit or stopped */
+ NM_DHCP_STATE_DONE, /* client reported it's stopping */
NM_DHCP_STATE_EXPIRE, /* lease expired or NAKed */
NM_DHCP_STATE_FAIL, /* failed for some reason */
NM_DHCP_STATE_TERMINATED, /* client is no longer running */