diff options
author | Dan Williams <dcbw@redhat.com> | 2014-10-30 14:23:00 -0500 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-10-31 09:26:27 +0100 |
commit | affaa94fc38a980a70534f70f6a6c58a4129b062 (patch) | |
tree | 88d496c844ecf308f14e7c2bd9dc9cdfeff35a6d /src/libsystemd-network | |
parent | 7cabba07745b388497e8c0fc19b61984167fd474 (diff) |
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.
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-client.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 0eba4c379d..1f7f238ca0 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -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)) |