From 51e8f5d63c1eb51d46a466f750daf178b93e55f3 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 21 Mar 2020 15:57:37 +0200 Subject: [PATCH] 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 --- src/common/ieee802_11_common.c | 5 +++++ 1 file changed, 5 insertions(+) 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;