From 963d3149abfcbab5b83f9023bc50321f777360d1 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 1 Dec 2017 22:21:24 +0200 Subject: [PATCH] nl80211: Fix NL80211_MESHCONF_AUTO_OPEN_PLINKS encoding 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 --- src/drivers/driver_nl80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 7571e77f0..58e6bf9d1 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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)) ||