1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 19:21:53 +03:00

sd-dhcp-client: clean up raw socket sd_event_source when creating new UDP socket

The raw socket sd_event_source used for DHCP server solicitations
was simply dropped on the floor when creating the new UDP socket
after a lease has been acquired.  Clean it up properly so we're
not still listening and responding to events on it.
This commit is contained in:
Dan Williams 2014-10-30 14:23:00 -05:00 committed by Tom Gundersen
parent 7cabba0774
commit affaa94fc3
Notes: Dave Reisner 2014-10-31 08:28:47 -04:00
Backport: bugfix

View File

@ -1269,6 +1269,9 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message,
if (r >= 0) {
client->timeout_resend =
sd_event_source_unref(client->timeout_resend);
client->receive_message =
sd_event_source_unref(client->receive_message);
client->fd = asynchronous_close(client->fd);
if (IN_SET(client->state, DHCP_STATE_REQUESTING,
DHCP_STATE_REBOOTING))