]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SME: MLD: Fix byte order for the link reconfig MLE control field
authorJouni Malinen <j@w1.fi>
Sat, 22 Feb 2025 08:45:11 +0000 (10:45 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 22 Feb 2025 08:45:11 +0000 (10:45 +0200)
This is a 16-bit bit little endian field and as such, needs to be
converted to host byte order before comparison.

Fixes: e5ea30feefa3 ("SME: MLD: Handle reconfiguration Multi-Link element")
Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/bss.c

index ee97d2162cccd080825b1fd426f05beeab705d7f..42630b6451ee55a1edac3e48d827609a670cf137 100644 (file)
@@ -1953,7 +1953,8 @@ u16 wpa_bss_parse_reconf_ml_element(struct wpa_supplicant *wpa_s,
                goto out;
 
        ml_common_len = 1;
-       if (ml->ml_control & RECONF_MULTI_LINK_CTRL_PRES_MLD_MAC_ADDR)
+       if (le_to_host16(ml->ml_control) &
+           RECONF_MULTI_LINK_CTRL_PRES_MLD_MAC_ADDR)
                ml_common_len += ETH_ALEN;
 
        if (len < sizeof(*ml) + ml_common_len) {