]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Add an 'allow/deny duplicates' statement that, if denied, prevents a
authorTed Lemon <source@isc.org>
Wed, 20 Oct 1999 20:54:42 +0000 (20:54 +0000)
committerTed Lemon <source@isc.org>
Wed, 20 Oct 1999 20:54:42 +0000 (20:54 +0000)
  client with a host declaration that matches by hardware address only
  from getting more than one lease through the use of that host
  declaration by releasing any other such leases.

server/dhcp.c

index 717ea12584bc431cf354275f4e446d55185599bd..98d59f01b0ade8602a3f7ae4816ed417e07b559e 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhcp.c,v 1.119 1999/10/20 16:52:25 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhcp.c,v 1.120 1999/10/20 20:54:42 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -957,7 +957,15 @@ void ack_lease (packet, lease, offer, when, msg)
                                        release_lease (seek, packet);
                                }
                        } while (seek);
-               } else {
+               }
+               if (!lease -> uid_len ||
+                   (lease -> host &&
+                    !lease -> host -> client_identifier.len &&
+                    (oc = lookup_option (&server_universe, state -> options,
+                                         SV_DUPLICATES)) &&
+                    !evaluate_boolean_option_cache (packet, lease,
+                                                    packet -> options,
+                                                    state -> options, oc))) {
                        do {
                                seek = (find_lease_by_hw_addr
                                        (lease -> hardware_addr.haddr,