aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-12-11 16:51:55 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-11 16:51:55 (GMT)
commit671a50392d32d6ca4ccf1611f23aea86806aaa4f (patch)
tree803eac0327a92620f2022db39d6b71ffad72ebcb /src
parentd9d87c3357bb7042fd4dc6858403fe5464698d01 (diff)
downloadhostap-671a50392d32d6ca4ccf1611f23aea86806aaa4f.zip
hostap-671a50392d32d6ca4ccf1611f23aea86806aaa4f.tar.gz
hostap-671a50392d32d6ca4ccf1611f23aea86806aaa4f.tar.bz2
nl80211: Clean up info on netdev or nl80211 not found errors
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver_nl80211.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index a7ae166..a797a3e 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2636,6 +2636,7 @@ err:
nl_destroy_handles(&global->nl_event);
nl_destroy_handles(&global->nl);
nl_cb_put(global->nl_cb);
+ global->nl_cb = NULL;
return -1;
}
@@ -6680,13 +6681,18 @@ static int wpa_driver_nl80211_set_mode(struct i802_bss *bss,
int ret = -1;
int i;
int was_ap = is_ap_interface(drv->nlmode);
+ int res;
- if (nl80211_set_mode(drv, drv->ifindex, nlmode) == 0) {
+ res = nl80211_set_mode(drv, drv->ifindex, nlmode);
+ if (res == 0) {
drv->nlmode = nlmode;
ret = 0;
goto done;
}
+ if (res == -ENODEV)
+ return -1;
+
if (nlmode == drv->nlmode) {
wpa_printf(MSG_DEBUG, "nl80211: Interface already in "
"requested mode - ignore error");
@@ -6701,7 +6707,6 @@ static int wpa_driver_nl80211_set_mode(struct i802_bss *bss,
wpa_printf(MSG_DEBUG, "nl80211: Try mode change after setting "
"interface down");
for (i = 0; i < 10; i++) {
- int res;
res = linux_set_iface_flags(drv->global->ioctl_sock,
bss->ifname, 0);
if (res == -EACCES || res == -ENODEV)