mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-01 06:45:27 +00:00
If we're responding to a BOOTP request, hunt for a lease that's applicable - there might be more than one lease matching the network and the hardware address.
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: dhcp.c,v 1.55 1997/12/02 09:07:03 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: dhcp.c,v 1.56 1997/12/02 09:28:08 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -1190,11 +1190,17 @@ struct lease *find_lease (packet, share, ours)
|
|||||||
packet -> raw -> hlen);
|
packet -> raw -> hlen);
|
||||||
/* Find the lease that's on the network the packet came from
|
/* Find the lease that's on the network the packet came from
|
||||||
(if any). */
|
(if any). */
|
||||||
for (; hw_lease; hw_lease = hw_lease -> n_hw)
|
for (; hw_lease; hw_lease = hw_lease -> n_hw) {
|
||||||
if (hw_lease -> shared_network == share)
|
if (hw_lease -> shared_network == share) {
|
||||||
break;
|
if (hw_lease -> flags & ABANDONED_LEASE)
|
||||||
if (hw_lease && (hw_lease -> flags & ABANDONED_LEASE))
|
continue;
|
||||||
hw_lease = (struct lease *)0;
|
if (packet -> packet_type)
|
||||||
|
break;
|
||||||
|
if (hw_lease -> flags &
|
||||||
|
(BOOTP_LEASE | DYNAMIC_BOOTP_OK))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Try to find a lease that's been allocated to the client's
|
/* Try to find a lease that's been allocated to the client's
|
||||||
IP address. */
|
IP address. */
|
||||||
|
Reference in New Issue
Block a user