aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bss.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2011-04-13 23:25:43 (GMT)
committerJouni Malinen <j@w1.fi>2011-04-13 23:25:43 (GMT)
commitf4fbba8cf92027b852443866e03217a4fe7644e5 (patch)
tree13dd025e88055e0e46c83f19463b28d305699af0 /wpa_supplicant/bss.c
parent714b8b53785aad33cefa003364dca34c0fa19a06 (diff)
downloadhostap-f4fbba8cf92027b852443866e03217a4fe7644e5.zip
hostap-f4fbba8cf92027b852443866e03217a4fe7644e5.tar.gz
hostap-f4fbba8cf92027b852443866e03217a4fe7644e5.tar.bz2
Distinguish empty concatenated vendor-specific IE from missing one
When comparing BSS table entries, handle empty concatenated vendor-specific IE differently from completely missing IE. This does not change anything for the only currently compared IE that can be fragmented (WPS IE), but it is better to have the generic code here ready for any possible new IE that could be used in with zero-length data.
Diffstat (limited to 'wpa_supplicant/bss.c')
-rw-r--r--wpa_supplicant/bss.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index b50ec3a..5b48951 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -169,8 +169,11 @@ static int are_ies_equal(const struct wpa_bss *old,
new_ie_len = new_ie ? new_ie[1] + 2 : 0;
}
- ret = (old_ie_len == new_ie_len &&
- os_memcmp(old_ie, new_ie, old_ie_len) == 0);
+ if (!old_ie || !new_ie)
+ ret = !old_ie && !new_ie;
+ else
+ ret = (old_ie_len == new_ie_len &&
+ os_memcmp(old_ie, new_ie, old_ie_len) == 0);
wpabuf_free(old_ie_buff);
wpabuf_free(new_ie_buff);