]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Pull up half of 1.61: reclaim abandoned leases.
authorTed Lemon <source@isc.org>
Mon, 18 May 1998 05:28:06 +0000 (05:28 +0000)
committerTed Lemon <source@isc.org>
Mon, 18 May 1998 05:28:06 +0000 (05:28 +0000)
server/dhcp.c

index c00a3afdd9abdb649168720daa0e9ceb6d755e1c..e1c26127242f4b0a6a352bc5f8a28d73fe586e59 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhcp.c,v 1.57 1997/12/06 04:04:50 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhcp.c,v 1.57.2.1 1998/05/18 05:28:06 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -116,6 +116,15 @@ void dhcpdiscover (packet)
                        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