]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Distinguish empty concatenated vendor-specific IE from missing one
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 13 Apr 2011 23:25:43 +0000 (02:25 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 13 Apr 2011 23:25:43 +0000 (02:25 +0300)
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.

wpa_supplicant/bss.c

index b50ec3a0e08d775d3f2cd1516b35147b61de2ee9..5b48951f02b6d7acced5c8c8eb59ebf2e011e5cf 100644 (file)
@@ -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);