chiark / gitweb /
libsystemd-dhcp: Unref event source before closing socket
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 20 Dec 2013 15:16:13 +0000 (17:16 +0200)
committerTom Gundersen <teg@jklm.no>
Sun, 22 Dec 2013 13:28:00 +0000 (14:28 +0100)
src/libsystemd-dhcp/dhcp-client.c

index 043d574..18a6e3c 100644 (file)
@@ -892,10 +892,10 @@ static int client_receive_raw_message(sd_event_source *s, int fd,
 
                         client_notify(client, DHCP_EVENT_IP_ACQUIRE);
 
-                        close(client->fd);
-                        client->fd = -1;
                         client->receive_message =
                                 sd_event_source_unref(client->receive_message);
+                        close(client->fd);
+                        client->fd = -1;
                 }
 
                 r = 0;