summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-04-12 19:17:08 +0000
committerRoy Marples <roy@marples.name>2009-04-12 19:17:08 +0000
commit9e707a85282f0f75322100ea495484d2d820351b (patch)
tree800a570bfd9f22e71e543acabd7cf0a1b792e55a
parent9b5d2fd4973594d721ee908abf2c79e80074727e (diff)
downloaddhcpcd-4.0.13.tar.xz
We should ignore DHCP messages without a ServerID, #166.dhcpcd-4.0.13
-rw-r--r--client.c7
1 files changed, 6 insertions, 1 deletions
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;
}