Teach get_recorded_lease() that static leases do not
authorkrw <krw@openbsd.org>
Wed, 21 Jun 2017 16:39:05 +0000 (16:39 +0000)
committerkrw <krw@openbsd.org>
Wed, 21 Jun 2017 16:39:05 +0000 (16:39 +0000)
expire.

sbin/dhclient/dhclient.c

index d025cf0..0201bfe 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dhclient.c,v 1.442 2017/06/21 15:49:27 krw Exp $      */
+/*     $OpenBSD: dhclient.c,v 1.443 2017/06/21 16:39:05 krw Exp $      */
 
 /*
  * Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -2580,7 +2580,7 @@ get_recorded_lease(struct interface_info *ifi)
                if (addressinuse(ifi, lp->address, ifname) &&
                    strncmp(ifname, ifi->name, IF_NAMESIZE) != 0)
                        continue;
-               else if (lp->expiry <= cur_time)
+               if (lp->is_static == 0 && lp->expiry <= cur_time)
                        continue;
 
                if (lp->is_static)