commit 9af25d937dee15717a753daaa128faaf598074d9
parent 8fd6985214fd9cf8f2b24c3d2fe1540bd5fe36bb
Author: Denis Kenzior <denkenz@gmail.com>
Date: Wed, 3 Feb 2021 12:55:18 -0600
station: Make sure bss_match also matches the ssid
Kernel might report hidden BSSes that are reported from beacon frames
separately than ones reported due to probe responses. This may confuse
the station network collation logic since the scan_bss generated by the
probe response might be removed erroneously when processing the scan_bss
that was generated due to a beacon.
Make sure that bss_match also takes the SSID into account and only
matches scan_bss structures that have the same BSSID and SSID contents.
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/station.c b/src/station.c
@@ -375,7 +375,13 @@ static bool bss_match(const void *a, const void *b)
const struct scan_bss *bss_a = a;
const struct scan_bss *bss_b = b;
- return !memcmp(bss_a->addr, bss_b->addr, sizeof(bss_a->addr));
+ if (memcmp(bss_a->addr, bss_b->addr, sizeof(bss_a->addr)))
+ return false;
+
+ if (bss_a->ssid_len != bss_b->ssid_len)
+ return false;
+
+ return !memcmp(bss_a->ssid, bss_b->ssid, bss_a->ssid_len);
}
struct bss_expiration_data {