]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix NL80211_MESHCONF_AUTO_OPEN_PLINKS encoding
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 1 Dec 2017 20:21:24 +0000 (22:21 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 1 Dec 2017 20:21:24 +0000 (22:21 +0200)
This nl80211 attribute uses NLA_U8 policy in cfg80211 and wpa_supplicant
needs to use same size when writing the attribute.

This fixes mesh mode regression triggered by kernel commit "net:
netlink: Update attr validation to require exact length for some types"
in v4.15-rc1 that resulted in the following debug log entry when trying
to join a mesh:
nl80211: mesh join failed: ret=-22 (Invalid argument)

Fixes: 6c1664f6051f ("nl80211: Add new commands to support mesh interfaces")
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/drivers/driver_nl80211.c

index 7571e77f0d33fd0f0277f6fd053aa3305206b8d5..58e6bf9d11ebe52baed8e2b2c0c63835aeeabcf0 100644 (file)
@@ -9026,8 +9026,8 @@ static int nl80211_put_mesh_config(struct nl_msg *msg,
                return -1;
 
        if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) &&
-            nla_put_u32(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS,
-                        params->auto_plinks)) ||
+            nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS,
+                       params->auto_plinks)) ||
            ((params->flags & WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS) &&
             nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS,
                         params->max_peer_links)) ||