Magellan Linux

Contents of /trunk/systemd/patches/systemd-217-sd-dhcp-client-clean-up-raw-socket-sd_event_source-w.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2524 - (show annotations) (download)
Mon Nov 17 13:56:31 2014 UTC (9 years, 5 months ago) by niro
File size: 1407 byte(s)
-upstream fixes
1 From d5a248dbe933c5cbe3ba3d0c5eb8a035018ba6af Mon Sep 17 00:00:00 2001
2 From: Dan Williams <dcbw@redhat.com>
3 Date: Thu, 30 Oct 2014 14:23:00 -0500
4 Subject: [PATCH] sd-dhcp-client: clean up raw socket sd_event_source when
5 creating new UDP socket
6
7 The raw socket sd_event_source used for DHCP server solicitations
8 was simply dropped on the floor when creating the new UDP socket
9 after a lease has been acquired. Clean it up properly so we're
10 not still listening and responding to events on it.
11 ---
12 src/libsystemd-network/sd-dhcp-client.c | 3 +++
13 1 file changed, 3 insertions(+)
14
15 diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
16 index 0eba4c3..1f7f238 100644
17 --- a/src/libsystemd-network/sd-dhcp-client.c
18 +++ b/src/libsystemd-network/sd-dhcp-client.c
19 @@ -1269,6 +1269,9 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message,
20 if (r >= 0) {
21 client->timeout_resend =
22 sd_event_source_unref(client->timeout_resend);
23 + client->receive_message =
24 + sd_event_source_unref(client->receive_message);
25 + client->fd = asynchronous_close(client->fd);
26
27 if (IN_SET(client->state, DHCP_STATE_REQUESTING,
28 DHCP_STATE_REBOOTING))
29 --
30 2.1.3
31