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
1 changed files with 5 additions and 0 deletions

View File

@ -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;