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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-03-21 15:57:37 +02:00
parent 5a296129fc
commit 51e8f5d63c

View file

@ -365,6 +365,11 @@ ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
elen); elen);
break; break;
} }
if (elems->ssid) {
wpa_printf(MSG_MSGDUMP,
"Ignored duplicated SSID element");
break;
}
elems->ssid = pos; elems->ssid = pos;
elems->ssid_len = elen; elems->ssid_len = elen;
break; break;