When removing duplicate dynamic leases from the cache, compare the
authorkrw <krw@openbsd.org>
Tue, 5 Dec 2017 14:57:14 +0000 (14:57 +0000)
committerkrw <krw@openbsd.org>
Tue, 5 Dec 2017 14:57:14 +0000 (14:57 +0000)
SSID against ifi->ssid, not the SSID of the new lease. They
should be the same, but this makes the intent clearer and removes
an assumption about the contents of ifi->active.

sbin/dhclient/dhclient.c

index 94a8560..efbe1c7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dhclient.c,v 1.534 2017/12/04 15:00:03 tb Exp $       */
+/*     $OpenBSD: dhclient.c,v 1.535 2017/12/05 14:57:14 krw Exp $      */
 
 /*
  * Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -1070,9 +1070,9 @@ newlease:
                        break;
                if (ifi->active == NULL)
                        continue;
-               if (ifi->active->ssid_len != lease->ssid_len)
+               if (ifi->ssid_len != lease->ssid_len)
                        continue;
-               if (memcmp(ifi->active->ssid, lease->ssid, lease->ssid_len)
+               if (memcmp(ifi->ssid, lease->ssid, lease->ssid_len)
                    != 0)
                        continue;
                if (ifi->active == lease)