[systemd-devel] [PATCH] sd-dhcp-client: clean up raw socket sd_event_source when creating new UDP socket
Tom Gundersen
teg at jklm.no
Thu Oct 30 13:39:40 PDT 2014
Applied. Thanks!
On Thu, Oct 30, 2014 at 8:23 PM, Dan Williams <dcbw at redhat.com> wrote:
> 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.
>
> ---
> src/libsystemd-network/sd-dhcp-client.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
> index dc9b2c2..5472082 100644
> --- a/src/libsystemd-network/sd-dhcp-client.c
> +++ b/src/libsystemd-network/sd-dhcp-client.c
> @@ -1310,6 +1310,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))
> --
> 1.9.3
>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
More information about the systemd-devel
mailing list