From: Ted Lemon Date: Fri, 24 Sep 1999 19:01:27 +0000 (+0000) Subject: Fix a potential problem when there are only two leases in a pool. X-Git-Tag: V3-BETA-1-PATCH-2~5^2~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cedac028f173ebe8e40b553ea28845fa69184c5d;p=thirdparty%2Fdhcp.git Fix a potential problem when there are only two leases in a pool. --- diff --git a/common/memory.c b/common/memory.c index b31ea545c..3c0f93bf3 100644 --- a/common/memory.c +++ b/common/memory.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: memory.c,v 1.60 1999/09/22 17:24:11 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: memory.c,v 1.61 1999/09/24 19:01:27 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -836,6 +836,8 @@ int supersede_lease (comp, lease, commit) the previous item on the list. */ if ((comp -> prev = lp -> prev)) comp -> prev -> next = comp; + else + comp -> pool -> leases = comp; comp -> next = lp; lp -> prev = comp; } @@ -856,6 +858,8 @@ int supersede_lease (comp, lease, commit) the next item on the list. */ if ((comp -> next = lp -> next)) comp -> next -> prev = comp; + else + comp -> pool -> last_lease = comp; comp -> prev = lp; lp -> next = comp; }