[RFC 1/2] driver_nl80211: remove excessive nl80211_set_mode() call

Eliad Peller eliad
Mon Jan 17 01:29:07 PST 2011


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 at wizery.com>
---
 src/drivers/driver_nl80211.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index acb8f33..e8ec38e 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2936,10 +2936,8 @@ static int wpa_driver_nl80211_authenticate(
 	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)
-		return -1;
+		if (wpa_driver_nl80211_set_mode(priv, IEEE80211_MODE_INFRA) < 0)
+			return -1;
 
 retry:
 	msg = nlmsg_alloc();
-- 
1.7.0.4




More information about the Hostap mailing list