From: Ted Lemon Date: Wed, 20 Oct 1999 20:54:42 +0000 (+0000) Subject: - Add an 'allow/deny duplicates' statement that, if denied, prevents a X-Git-Tag: BCTEL_SPECIAL_19991124~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d846dd048da922e0a3346343219cae45ec6d9bcd;p=thirdparty%2Fdhcp.git - Add an 'allow/deny duplicates' statement that, if denied, prevents a 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. --- diff --git a/server/dhcp.c b/server/dhcp.c index 717ea1258..98d59f01b 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -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,