From: krw Date: Tue, 5 Dec 2017 14:57:14 +0000 (+0000) Subject: When removing duplicate dynamic leases from the cache, compare the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=93e37ff1ece7771acd99769ee1b28bd3233401be;p=openbsd When removing duplicate dynamic leases from the cache, compare the 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. --- diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 94a85602f8d..efbe1c76797 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -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 @@ -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)