From: Roy Marples Date: Sun, 12 Apr 2009 19:17:08 +0000 (+0000) Subject: We should ignore DHCP messages without a ServerID, #166. X-Git-Tag: v4.0.13^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e707a85282f0f75322100ea495484d2d820351b;p=thirdparty%2Fdhcpcd.git We should ignore DHCP messages without a ServerID, #166. --- diff --git a/client.c b/client.c index e9645662..394bde2d 100644 --- 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; }