From beeb067c71b4b67778badb6eed6ee2dd00a5218f Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 3 Mar 2020 09:50:43 +0100 Subject: [PATCH] dhcp/nettools: first clear source before emitting event in dhcp4_event_cb() A similar patch was done on master, but here the situation is different. I feel we should not allow for the possibility where we invoke an event that might mess with the source id. In practice there was no problem. But it feels cleaner to clear it first. Fixes: 843d696e46d9 ('dhcp: clean source on dispatch failure') (cherry picked from commit 0549351111ccfde9d6a404952c43234612028d13) --- src/dhcp/nm-dhcp-nettools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcp/nm-dhcp-nettools.c b/src/dhcp/nm-dhcp-nettools.c index 2af73cdc3c..622251a31c 100644 --- a/src/dhcp/nm-dhcp-nettools.c +++ b/src/dhcp/nm-dhcp-nettools.c @@ -1073,8 +1073,8 @@ dhcp4_event_cb (GIOChannel *source, * a predefined number of times (possibly infinite). */ _LOGE ("error %d dispatching events", r); - nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_FAIL, NULL, NULL); priv->event_id = 0; + nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_FAIL, NULL, NULL); return G_SOURCE_REMOVE; }