]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Ignore duplicated SSID element when parsing
authorJouni Malinen <j@w1.fi>
Sat, 21 Mar 2020 13:57:37 +0000 (15:57 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 21 Mar 2020 15:12:29 +0000 (17:12 +0200)
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>
src/common/ieee802_11_common.c

index 5da92eaef3579556d33581918d8dc3afbe491e85..6aa38cab28e60d284c690f4d27d6d7ee9ad7e40b 100644 (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;