aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-12-30 20:11:40 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-31 07:16:27 (GMT)
commit2eef5177adbf8d14c800fba90f7fb0ccce36db6d (patch)
treeba4a7e88d156bd9d5ef89db060cdaa3fcc5d4cec /src
parenta0bdd1916f4b36aaca49db008dbcb7d7e8fc48d3 (diff)
downloadhostap-2eef5177adbf8d14c800fba90f7fb0ccce36db6d.zip
hostap-2eef5177adbf8d14c800fba90f7fb0ccce36db6d.tar.gz
hostap-2eef5177adbf8d14c800fba90f7fb0ccce36db6d.tar.bz2
nl80211: Report set_supp_port failures in debug log
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver_nl80211.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index db718c6..fd4059c 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -8523,6 +8523,12 @@ static int wpa_driver_nl80211_set_supp_port(void *priv, int authorized)
struct wpa_driver_nl80211_data *drv = bss->drv;
struct nl_msg *msg;
struct nl80211_sta_flag_update upd;
+ int ret = -ENOBUFS;
+
+ if (!drv->associated && is_zero_ether_addr(drv->bssid) && !authorized) {
+ wpa_printf(MSG_DEBUG, "nl80211: Skip set_supp_port(unauthorized) while not associated");
+ return 0;
+ }
wpa_printf(MSG_DEBUG, "nl80211: Set supplicant port %sauthorized for "
MACSTR, authorized ? "" : "un", MAC2STR(drv->bssid));
@@ -8543,10 +8549,15 @@ static int wpa_driver_nl80211_set_supp_port(void *priv, int authorized)
upd.set = BIT(NL80211_STA_FLAG_AUTHORIZED);
NLA_PUT(msg, NL80211_ATTR_STA_FLAGS2, sizeof(upd), &upd);
- return send_and_recv_msgs(drv, msg, NULL, NULL);
+ ret = send_and_recv_msgs(drv, msg, NULL, NULL);
+ msg = NULL;
+ if (!ret)
+ return 0;
nla_put_failure:
nlmsg_free(msg);
- return -ENOBUFS;
+ wpa_printf(MSG_DEBUG, "nl80211: Failed to set STA flag: %d (%s)",
+ ret, strerror(-ret));
+ return ret;
}