changeset 1276:7682aae81f57 draft dhcpcd-4.0.13

We should ignore DHCP messages without a ServerID, #166.
author Roy Marples <roy@marples.name>
date Sun, 12 Apr 2009 19:17:08 +0000
parents 2c0ecff50c53
children 8f58de20b745
files client.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client.c	Wed Mar 11 17:58:34 2009 +0000
+++ b/client.c	Sun Apr 12 19:17:08 2009 +0000
@@ -1389,7 +1389,12 @@
 
 	/* 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;
 	}