]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Remove excessive nl80211_set_mode() call
authorEliad Peller <eliad@wizery.com>
Tue, 1 Feb 2011 14:38:38 +0000 (16:38 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 1 Feb 2011 14:38:38 +0000 (16:38 +0200)
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>
src/drivers/driver_nl80211.c

index 7b671a890561306937108973b5e04017c7e0734f..e6df6f0fc3fb24afe5ff7aeebae5fbfb498a41b6 100644 (file)
@@ -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: