]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
We should ignore DHCP messages without a ServerID, #166. v4.0.13
authorRoy Marples <roy@marples.name>
Sun, 12 Apr 2009 19:17:08 +0000 (19:17 +0000)
committerRoy Marples <roy@marples.name>
Sun, 12 Apr 2009 19:17:08 +0000 (19:17 +0000)
client.c

index e9645662fa926899e8248b49835f097e13f59d19..394bde2d8fb4f8ee44cafb4279fa604a81071320 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1389,7 +1389,12 @@ handle_dhcp(struct if_state *state, struct dhcp_message **dhcpp,
 
        /* We have to have DHCP type to work */
        if (get_option_uint8(&type, dhcp, DHO_MESSAGETYPE) == -1) {
-               log_dhcp(LOG_ERR, "no DHCP type in", dhcp);
+               logger(LOG_ERR, "ignoring message; no DHCP type");
+               return 0;
+       }
+       /* Every DHCP message should include ServerID */
+       if (get_option_addr(&addr.s_addr, dhcp, DHO_SERVERID) == -1) {
+               logger(LOG_ERR, "ignoring message; no Server ID");
                return 0;
        }