[systemd-commits] src/libsystemd-dhcp

Tom Gundersen tomegun at kemper.freedesktop.org
Tue Dec 17 07:19:32 PST 2013


 src/libsystemd-dhcp/dhcp-client.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 97b9372db178baadb121634fb4ae12bda8969cfe
Author: Patrik Flykt <patrik.flykt at linux.intel.com>
Date:   Tue Dec 17 16:24:16 2013 +0100

    dhcp: Properly handle unsuccessful cases for DHCP Ack
    
    Ignore DHCP Ack packets if they are found to be erroneous or have
    an unexpected xid by setting the result to zero instead of propagating
    an error. Also remember to report a DHCP Nak and stop the DHCP client.

diff --git a/src/libsystemd-dhcp/dhcp-client.c b/src/libsystemd-dhcp/dhcp-client.c
index 01d406c..c0c348c 100644
--- a/src/libsystemd-dhcp/dhcp-client.c
+++ b/src/libsystemd-dhcp/dhcp-client.c
@@ -897,6 +897,9 @@ static int client_receive_raw_message(sd_event_source *s, int fd,
                         client->receive_message =
                                 sd_event_source_unref(client->receive_message);
                 }
+
+                r = 0;
+
                 break;
 
         case DHCP_STATE_INIT:
@@ -910,7 +913,7 @@ static int client_receive_raw_message(sd_event_source *s, int fd,
         }
 
 error:
-        if (r < 0)
+        if (r < 0 || r == DHCP_EVENT_NO_LEASE)
                 return client_stop(client, r);
 
         return 0;



More information about the systemd-commits mailing list