2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-02 15:25:48 +00:00

Fix corner case where REBIND would be ignored rather than NAKed.

This commit is contained in:
Ted Lemon
2000-03-07 02:50:45 +00:00
parent cb9cf4bd2b
commit 164f9c7e2f

View File

@@ -22,7 +22,7 @@
#ifndef lint #ifndef lint
static char copyright[] = static char copyright[] =
"$Id: dhcp.c,v 1.140 2000/03/06 23:33:52 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; "$Id: dhcp.c,v 1.141 2000/03/07 02:50:45 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -215,7 +215,10 @@ void dhcprequest (packet, ms_nulltp)
If ciaddr was specified and Requested Address was not, then If ciaddr was specified and Requested Address was not, then
we really only know for sure what network a packet came from we really only know for sure what network a packet came from
if it came through a BOOTP gateway - if it came through an if it came through a BOOTP gateway - if it came through an
IP router, we'll just have to assume that it's cool. IP router, we can't respond. However, a client in REBINDING
state with the wrong IP address will also look like this, and
this is more likely, so we NAK these packets - if the packet
came through a router, the NAK won't reach the client anyway.
If we don't think we know where the packet came from, it If we don't think we know where the packet came from, it
came through a gateway from an unknown network, so it's not came through a gateway from an unknown network, so it's not
@@ -251,6 +254,7 @@ void dhcprequest (packet, ms_nulltp)
if (!packet -> shared_network || if (!packet -> shared_network ||
(packet -> raw -> ciaddr.s_addr && (packet -> raw -> ciaddr.s_addr &&
packet -> raw -> giaddr.s_addr) || packet -> raw -> giaddr.s_addr) ||
(!oc && packet -> raw -> ciaddr.s_addr) ||
(oc && !packet -> raw -> ciaddr.s_addr)) { (oc && !packet -> raw -> ciaddr.s_addr)) {
/* If we don't know where it came from but we do know /* If we don't know where it came from but we do know