From 1b3dd41a357d759e93ca7512ee429250523cdf82 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 2 Apr 2013 02:30:04 +0200 Subject: [PATCH] Never join a network if not explicitly configured. The scanning still occurs so that the network list is populated. But if no SSID has been explicitly configured, we now always set the IEEE80211_SCAN_NOJOIN flag that prevents automatically joining open networks at the end of the scan. --- src/libs/compat/freebsd_wlan/net80211/ieee80211_scan.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libs/compat/freebsd_wlan/net80211/ieee80211_scan.c b/src/libs/compat/freebsd_wlan/net80211/ieee80211_scan.c index 68a0ea4542..9fbeb91f31 100644 --- a/src/libs/compat/freebsd_wlan/net80211/ieee80211_scan.c +++ b/src/libs/compat/freebsd_wlan/net80211/ieee80211_scan.c @@ -411,6 +411,15 @@ start_scan_locked(const struct ieee80211_scanner *scan, , flags & IEEE80211_SCAN_ONCE ? ", once" : "" ); +#ifdef __HAIKU__ + /* We never want to join if not explicitly looking for an SSID */ + if (nssid == 0 && (flags & IEEE80211_SCAN_NOJOIN) == 0) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, + "%s: setting nojoin due to no configured ssid\n", __func__); + flags |= IEEE80211_SCAN_NOJOIN; + } +#endif + scan_update_locked(vap, scan); if (ss->ss_ops != NULL) { if ((flags & IEEE80211_SCAN_NOSSID) == 0)