From: Ted Lemon Date: Tue, 5 Oct 1999 00:04:43 +0000 (+0000) Subject: - Move handling of on_release hooks and nsupdate to release_lease(). X-Git-Tag: V3-BETA-1-PATCH-2~5^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a05b1425f63c7bdd5d8c2c38500596a0e71b1c03;p=thirdparty%2Fdhcp.git - Move handling of on_release hooks and nsupdate to release_lease(). - If one-lease-per-client is true, release the other lease even if it hasn't yet expired. --- diff --git a/server/dhcp.c b/server/dhcp.c index 8817f05f2..121b7a3e1 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.110 1999/10/04 23:51:45 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.111 1999/10/05 00:04:43 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -295,21 +295,8 @@ void dhcprelease (packet) lease ? "" : "not "); /* If we found a lease, release it. */ - if (lease) { -#if defined (NSUPDATE) && 0 - nsupdate (lease, lease -> state, packet, DELETE); -#endif - /* If there are statements to execute when the lease is - committed, execute them. */ - if (lease -> on_release) { - execute_statements (packet, lease, packet -> options, - (struct option_state *)0, /* XXX */ - lease -> on_release); - executable_statement_dereference (&lease -> on_release, - "dhcprelease"); - } + if (lease) release_lease (lease); - } } void dhcpdecline (packet) @@ -941,8 +928,7 @@ void ack_lease (packet, lease, offer, when, msg) /* Don't release expired leases, and don't release the lease we're going to assign. */ while (seek) { - if (seek != lease && - seek -> ends > cur_time) + if (seek != lease) break; seek = lease -> n_uid; } @@ -956,8 +942,7 @@ void ack_lease (packet, lease, offer, when, msg) (lease -> hardware_addr.haddr, lease -> hardware_addr.hlen)); while (seek) { - if (seek != lease && - seek -> ends > cur_time) + if (seek != lease) break; seek = lease -> n_hw; }