lkundrak / rpms / hostapd

Forked from rpms/hostapd 4 years ago
Clone
b44ff58
From a2426829ce426de82d2fa47071ca41ea81c43307 Mon Sep 17 00:00:00 2001
b44ff58
Message-Id: <a2426829ce426de82d2fa47071ca41ea81c43307.1527581614.git.davide.caratti@gmail.com>
b44ff58
From: Jouni Malinen <jouni@qca.qualcomm.com>
b44ff58
Date: Fri, 1 Dec 2017 20:22:44 +0200
b44ff58
Subject: [PATCH] nl80211: Fix NL80211_ATTR_SMPS_MODE encoding
b44ff58
b44ff58
This nl80211 attribute uses NLA_U8 policy in cfg80211 and
b44ff58
hostapd/wpa_supplicant needs to use same size when writing the
b44ff58
attribute.
b44ff58
b44ff58
This fixes AP mode regression triggered by kernel commit "net: netlink:
b44ff58
Update attr validation to require exact length for some types" in
b44ff58
v4.15-rc1 that resulted in the following debug log entry when trying to
b44ff58
enable beaconing:
b44ff58
nl80211: Beacon set failed: -34 (Numerical result out of range)
b44ff58
b44ff58
Fixes: da1080d7215f ("nl80211: Advertise and configure SMPS modes")
b44ff58
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
b44ff58
---
b44ff58
 src/drivers/driver_nl80211.c | 2 +-
b44ff58
 1 file changed, 1 insertion(+), 1 deletion(-)
b44ff58
b44ff58
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
b44ff58
index 2ce03ed76..7571e77f0 100644
b44ff58
--- a/src/drivers/driver_nl80211.c
b44ff58
+++ b/src/drivers/driver_nl80211.c
b44ff58
@@ -3957,7 +3957,7 @@ static int wpa_driver_nl80211_set_ap(void *priv,
b44ff58
 			smps_mode = NL80211_SMPS_OFF;
b44ff58
 			break;
b44ff58
 		}
b44ff58
-		if (nla_put_u32(msg, NL80211_ATTR_SMPS_MODE, smps_mode))
b44ff58
+		if (nla_put_u8(msg, NL80211_ATTR_SMPS_MODE, smps_mode))
b44ff58
 			goto fail;
b44ff58
 	}
b44ff58
 
b44ff58
-- 
b44ff58
2.17.0
b44ff58