diff options
author | David Hankins <dhankins@isc.org> | 2006-01-06 22:09:23 +0000 |
---|---|---|
committer | David Hankins <dhankins@isc.org> | 2006-01-06 22:09:23 +0000 |
commit | 2d07c89f495e53f28c3c954b1b97f7d0ae742b47 (patch) | |
tree | de38a7c16e3cc080a2cb4512a6b3971b2ee4ca74 | |
parent | d3ed0ea8ea96623ed55949b2f90b5ada351e05e9 (diff) | |
download | isc-dhcp-2d07c89f495e53f28c3c954b1b97f7d0ae742b47.tar.gz |
- The server was inappropriately sending leases to the RESET state in the
event that multiple active leases were found to match a singly-identified
client. This was changed to RELEASED (by accepting a different, ACTIVE
binding, the client is implicitly releasing its lease). This repairs a
bug wherein secondary servers in failover pairs detecting this condition
move leases to RESET, and primaries refuse to accept that state
transition (properly). [ISC-Bugs #15718]
-rw-r--r-- | RELNOTES | 8 | ||||
-rw-r--r-- | server/dhcp.c | 18 |
2 files changed, 22 insertions, 4 deletions
@@ -54,6 +54,14 @@ and for prodding me into improving it. messages also log the 'effective client ip address' rather than the client's supplied ciaddr (since some clients produce null ciaddrs). +- The server was inappropriately sending leases to the RESET state in the + event that multiple active leases were found to match a singly-identified + client. This was changed to RELEASED (by accepting a different, ACTIVE + binding, the client is implicitly releasing its lease). This repairs a + bug wherein secondary servers in failover pairs detecting this condition + move leases to RESET, and primaries refuse to accept that state + transition (properly). + Changes since 3.0.4b1 - Command line parsing in omshell was repaired - it no longer closes diff --git a/server/dhcp.c b/server/dhcp.c index 58e924a2..6c3c3151 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.192.2.58 2006/01/06 22:07:11 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.192.2.59 2006/01/06 22:09:23 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -3335,7 +3335,7 @@ int find_lease (struct lease **lp, (share == uid_lease -> subnet -> shared_network) && packet -> packet_type == DHCPREQUEST) - dissociate_lease (uid_lease); + release_lease (uid_lease, packet); } lease_dereference (&uid_lease, MDL); lease_reference (&uid_lease, ip_lease, MDL); @@ -3405,8 +3405,10 @@ int find_lease (struct lease **lp, permitted (packet, ip_lease -> pool -> prohibit_list)) || (ip_lease -> pool -> permit_list && !permitted (packet, ip_lease -> pool -> permit_list)))) { - if (!packet -> raw -> ciaddr.s_addr) + if (!packet->raw->ciaddr.s_addr && + (ip_lease->binding_state == FTS_ACTIVE)) release_lease (ip_lease, packet); + lease_dereference (&ip_lease, MDL); } @@ -3483,10 +3485,18 @@ int find_lease (struct lease **lp, the lease that matched the client identifier. */ if (uid_lease) { if (lease) { + log_error("uid lease %s for client %s is duplicate " + "on %s", + piaddr(uid_lease->ip_addr), + print_hw_addr(packet->raw->htype, + packet->raw->hlen, + packet->raw->chaddr), + uid_lease->subnet->shared_network->name); + if (!packet -> raw -> ciaddr.s_addr && packet -> packet_type == DHCPREQUEST && uid_lease -> binding_state == FTS_ACTIVE) - dissociate_lease (uid_lease); + release_lease (uid_lease, packet); #if defined (DEBUG_FIND_LEASE) log_info ("not choosing uid lease."); #endif |