aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-02-01 14:38:38 (GMT)
committerJouni Malinen <j@w1.fi>2011-02-01 14:38:38 (GMT)
commitf14f5141a03b0fee2ab54f64094ac6a7d07b373b (patch)
tree6dc31eeadf9ae964abae2d056c00efc8f77a25c1 /src
parent7615078caf48287df056abf77dcb5e3537bef978 (diff)
downloadhostap-f14f5141a03b0fee2ab54f64094ac6a7d07b373b.zip
hostap-f14f5141a03b0fee2ab54f64094ac6a7d07b373b.tar.gz
hostap-f14f5141a03b0fee2ab54f64094ac6a7d07b373b.tar.bz2
nl80211: Remove excessive nl80211_set_mode() call
When authenticating, and the interface type is not already NL80211_IFTYPE_STATION, we need to call wpa_driver_nl80211_set_mode() only once. Remove the excessive call. Signed-off-by: Eliad Peller <eliad@wizery.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver_nl80211.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 7b671a8..e6df6f0 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2947,10 +2947,8 @@ static int wpa_driver_nl80211_authenticate(
drv->associated = 0;
os_memset(drv->auth_bssid, 0, ETH_ALEN);
/* FIX: IBSS mode */
- if (drv->nlmode != NL80211_IFTYPE_STATION)
- wpa_driver_nl80211_set_mode(priv, IEEE80211_MODE_INFRA);
-
- if (wpa_driver_nl80211_set_mode(priv, IEEE80211_MODE_INFRA) < 0)
+ if (drv->nlmode != NL80211_IFTYPE_STATION &&
+ wpa_driver_nl80211_set_mode(priv, IEEE80211_MODE_INFRA) < 0)
return -1;
retry: