From: Ted Lemon Date: Fri, 8 Oct 1999 22:21:34 +0000 (+0000) Subject: - Make the error messages generated based on authority more authoritative. X-Git-Tag: BCTEL_SPECIAL_19991124~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e89a5afe91767a1581b1642d44cc26d58512e590;p=thirdparty%2Fdhcp.git - Make the error messages generated based on authority more authoritative. - Don't respond to DHCPINFORM messages on subnets for which we are not authoritative. --- diff --git a/server/dhcp.c b/server/dhcp.c index 69da9895a..9a1aabfe7 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.115 1999/10/07 06:42:53 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.116 1999/10/08 22:21:34 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -209,7 +209,7 @@ void dhcprequest (packet) return; } /* Otherwise, ignore it. */ - log_info ("%s: ignored.", msgbuf); + log_info ("%s: ignored (not authoritative).", msgbuf); return; } @@ -223,7 +223,7 @@ void dhcprequest (packet) nak_lease (packet, &cip); return; } - log_info ("%s: ignored.", msgbuf); + log_info ("%s: ignored (not authoritative).", msgbuf); return; } } @@ -372,7 +372,7 @@ void dhcpinform (packet) /* If the IP source address is zero, don't respond. */ if (!memcmp (cip.iabuf, "\0\0\0", 4)) { - log_info ("%s: ignored.", msgbuf); + log_info ("%s: ignored (null source address).", msgbuf); return; } @@ -386,6 +386,16 @@ void dhcpinform (packet) msgbuf, inet_ntoa (packet -> raw -> giaddr)); } + /* We don't respond to DHCPINFORM packets if we're not authoritative. + It would be nice if a per-host value could override this, but + there's overhead involved in checking this, so let's see how people + react first. */ + if (!subnet -> group -> authoritative) { + log_info ("%s: not authoritative for subnet %s", + msgbuf, piaddr (subnet -> net)); + return; + } + memset (&d1, 0, sizeof d1); option_state_allocate (&options, "dhcpinform"); memset (&outgoing, 0, sizeof outgoing);