nl80211: Fixed set_mode() to actually use adhoc/station nl80211 variables
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 15 Aug 2008 14:52:37 +0000 (17:52 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 15 Aug 2008 14:52:37 +0000 (17:52 +0300)
src/drivers/driver_nl80211.c

index 777b097..7352742 100644 (file)
@@ -1961,7 +1961,8 @@ static int wpa_driver_nl80211_set_mode(void *priv, int mode)
        genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0,
                    0, NL80211_CMD_SET_INTERFACE, 0);
        NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
-       NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, NL80211_IFTYPE_AP);
+       NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE,
+                   mode ? NL80211_IFTYPE_ADHOC : NL80211_IFTYPE_STATION);
 
        if (nl_send_auto_complete(drv->nl_handle, msg) < 0 ||
            nl_wait_for_ack(drv->nl_handle) < 0)