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: 843d696e46 ('dhcp: clean source on dispatch failure')
(cherry picked from commit 0549351111)
This commit is contained in:
Thomas Haller 2020-03-03 09:50:43 +01:00
parent 7a004ef0bb
commit beeb067c71

View file

@ -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;
}