#ifndef lint
static char copyright[] =
-"$Id: dhcp.c,v 1.60 1998/03/17 06:20:51 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhcp.c,v 1.61 1998/03/17 18:14:51 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
return;
}
+ /* If we find an abandoned lease, take it, but print a
+ warning message, so that if it continues to lose,
+ the administrator will eventually investigate. */
+ if (lease -> flags & ABANDONED_LEASE) {
+ warn ("Reclaiming abandoned IP address %s.\n",
+ piaddr (lease -> ip_addr));
+ lease -> flags &= ~ABANDONED_LEASE;
+ }
+
/* Try to find a host_decl that matches the client
identifier or hardware address on the packet, and
has no fixed IP address. If there is one, hang
packet -> raw -> hlen,
packet -> raw -> chaddr),
ip_lease -> shared_network -> name);
+
+ /* If the client is REQUESTing the lease, it shouldn't
+ still be using the old one, so we can free it for
+ allocation. This is only true if the duplicate
+ lease is on the same network, of course. */
+
+ if (packet -> packet_type == DHCPREQUEST &&
+ share == uid_lease -> shared_network)
+ dissociate_lease (uid_lease);
+
uid_lease = ip_lease;
}
ip_lease = (struct lease *)0;