From: Jouni Malinen Date: Sat, 21 Mar 2020 13:57:37 +0000 (+0200) Subject: Ignore duplicated SSID element when parsing X-Git-Tag: hostap_2_10~1599 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51e8f5d63c1eb51d46a466f750daf178b93e55f3;p=thirdparty%2Fhostap.git Ignore duplicated SSID element when parsing Some APs have managed to add two SSID elements into Beacon frames and that used to result in picking the last one which had incorrect data in the known examples of this misbehavior. Pick the first one to get the correct SSID. Signed-off-by: Jouni Malinen --- diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index 5da92eaef..6aa38cab2 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -365,6 +365,11 @@ ParseRes ieee802_11_parse_elems(const u8 *start, size_t len, elen); break; } + if (elems->ssid) { + wpa_printf(MSG_MSGDUMP, + "Ignored duplicated SSID element"); + break; + } elems->ssid = pos; elems->ssid_len = elen; break;