summaryrefslogtreecommitdiffstats
path: root/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c
diff options
context:
space:
mode:
authorbschmidt <bschmidt@FreeBSD.org>2010-04-10 13:54:00 +0000
committerbschmidt <bschmidt@FreeBSD.org>2010-04-10 13:54:00 +0000
commita98b1eb99d6bf1fe47d49c33fcdcab7c8709ed7c (patch)
tree54851ae20002dab4a38a642861b996e212912609 /usr.sbin/wpa/wpa_supplicant/driver_freebsd.c
parentd89608b359c0241db9538907fc2d58a4d53e7109 (diff)
downloadFreeBSD-src-a98b1eb99d6bf1fe47d49c33fcdcab7c8709ed7c.zip
FreeBSD-src-a98b1eb99d6bf1fe47d49c33fcdcab7c8709ed7c.tar.gz
Add WPA-None support:
* WPA-None requires ap_scan=2: The major difference between ap_scan=1 (default) and 2 is, that no IEEE80211_IOC_SCAN* ioctls/functions are called, though, there is a dependency on those. For example the call to wpa_driver_bsd_scan() sets the interface UP, this never happens, therefore the interface must be marked up in wpa_driver_bsd_associate(). IEEE80211_IOC_SSID also is not called, which means that the SSID has not been set prior to the IEEE80211_MLME_ASSOC call. * WPA-None has no support for sequence number updates, it doesn't make sense to check for replay violations.. * I had some crashes right after the switch to RUN state, issue is that sc->sc_lastrs was not yet defined. Approved by: rpaulo (mentor) MFC after: 3 weeks
Diffstat (limited to 'usr.sbin/wpa/wpa_supplicant/driver_freebsd.c')
-rw-r--r--usr.sbin/wpa/wpa_supplicant/driver_freebsd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c b/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c
index ec8ae98..65989c2 100644
--- a/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c
+++ b/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c
@@ -396,7 +396,7 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params)
{
struct wpa_driver_bsd_data *drv = priv;
struct ieee80211req_mlme mlme;
- int privacy;
+ int flags, privacy;
wpa_printf(MSG_DEBUG,
"%s: ssid '%.*s' wpa ie len %u pairwise %u group %u key mgmt %u"
@@ -408,6 +408,17 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params)
, params->key_mgmt_suite
);
+ /* NB: interface must be marked UP to associate */
+ if (getifflags(drv, &flags) != 0) {
+ wpa_printf(MSG_DEBUG, "%s did not mark interface UP", __func__);
+ return -1;
+ }
+ if ((flags & IFF_UP) == 0 && setifflags(drv, flags | IFF_UP) != 0) {
+ wpa_printf(MSG_DEBUG, "%s unable to mark interface UP",
+ __func__);
+ return -1;
+ }
+
/* XXX error handling is wrong but unclear what to do... */
if (wpa_driver_bsd_set_wpa_ie(drv, params->wpa_ie, params->wpa_ie_len) < 0)
return -1;
OpenPOWER on IntegriCloud