From: Ted Lemon Date: Sat, 17 Mar 2001 00:48:34 +0000 (+0000) Subject: - Fix a bug that would cause the server to spin looking for leases to free. X-Git-Tag: V3-BETA-2-PATCH-20~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1820749bd7f330a1a69e25296f2e78b5a4fe554;p=thirdparty%2Fdhcp.git - Fix a bug that would cause the server to spin looking for leases to free. - Fix a non-null pointer store. --- diff --git a/server/dhcp.c b/server/dhcp.c index f13367734..14f7756af 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.185 2001/03/16 01:55:38 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.186 2001/03/17 00:48:34 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1488,8 +1488,9 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) seek = (struct lease *)0; find_lease_by_uid (&seek, lease -> uid, lease -> uid_len, MDL); - if (!seek) + if (!seek || (seek == lease && !seek -> n_uid)) break; + next = (struct lease *)0; /* Don't release expired leases, and don't release the lease we're going to assign. */ @@ -1530,7 +1531,7 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) find_lease_by_hw_addr (&seek, lease -> hardware_addr.hbuf, lease -> hardware_addr.hlen, MDL); - if (!seek) + if (!seek || (seek == lease && !seek -> n_hw)) break; next = (struct lease *)0; while (seek) {