summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/dhcp/dhclient/dhclient.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/dhcp/dhclient/dhclient.c b/usr.sbin/dhcp/dhclient/dhclient.c
index 2d40a89b208..4bac3573d0b 100644
--- a/usr.sbin/dhcp/dhclient/dhclient.c
+++ b/usr.sbin/dhcp/dhclient/dhclient.c
@@ -56,7 +56,7 @@
#ifndef lint
static char copyright[] =
-"$Id: dhclient.c,v 1.9 2000/07/21 00:33:53 beck Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.10 2000/10/26 20:35:32 beck Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -627,6 +627,24 @@ void dhcp (packet)
return;
}
+ if (packet->packet_type != DHCPNAK) {
+ /* RFC2131 table 3 specifies that only DHCPNAK can
+ * specify yiaddr of 0, Some buggy dhcp servers
+ * can set yiaddr to 0 on non-DHCPNAK packets
+ * we ignore those here.
+ */
+ struct in_addr tmp;
+ memset(&tmp, 0, sizeof(struct in_addr));
+
+ if (memcmp(&tmp, &packet -> raw -> yiaddr, sizeof(tmp)) == 0)
+ {
+ note (
+ "%s from %s rejected due to bogus yiaddr of 0.0.0.0.",
+ type, piaddr (packet->client_addr));
+ return;
+ }
+ }
+
/* If there's a reject list, make sure this packet's sender isn't
on it. */
for (ap = packet -> interface -> client -> config -> reject_list;