From: Jouni Malinen Date: Fri, 15 Aug 2008 14:52:37 +0000 (+0300) Subject: nl80211: Fixed set_mode() to actually use adhoc/station nl80211 variables X-Git-Tag: hostap_0_6_5~103 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a4e6cbf88893152544291caf97631dcf1816340;p=thirdparty%2Fhostap.git nl80211: Fixed set_mode() to actually use adhoc/station nl80211 variables --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 777b09745..73527423e 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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)