]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Reset nlmode to station on leaving IBSS
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 25 Sep 2013 20:14:41 +0000 (23:14 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 25 Sep 2013 20:14:41 +0000 (23:14 +0300)
Previously, IBSS mode (NL80211_IFTYPE_ADHOC) was left in drv->nlmode
when leaving IBSS. This causes issues for send_mlme() handler for P2P
Probe Response transmission in Listen state. Fix this by clearing nlmode
back to NL80211_IFTYPE_STATION on leaving IBSS so that following P2P
operations can be executed correctly. Previously, this was fixed only
when the next authentication/association attempt in station mode
occured.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/drivers/driver_nl80211.c

index ea07e087026730af413c8e0e7a95fc7c115c94bb..d0ab58c28215280cb33f134da927c30d396b8fc6 100644 (file)
@@ -7525,6 +7525,12 @@ static int nl80211_leave_ibss(struct wpa_driver_nl80211_data *drv)
        wpa_printf(MSG_DEBUG, "nl80211: Leave IBSS request sent successfully");
 
 nla_put_failure:
+       if (wpa_driver_nl80211_set_mode(&drv->first_bss,
+                                       NL80211_IFTYPE_STATION)) {
+               wpa_printf(MSG_INFO, "nl80211: Failed to set interface into "
+                          "station mode");
+       }
+
        nlmsg_free(msg);
        return ret;
 }