Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Jul 2022 12:28:01 +0000
From:      bugzilla-noreply@freebsd.org
To:        wireless@FreeBSD.org
Subject:   [Bug 264238] wpa_supplicant 2.10 fails to associate to open secondary VAP when primary VAP is WPA
Message-ID:  <bug-264238-21060-nfq8GXQOlU@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-264238-21060@https.bugs.freebsd.org/bugzilla/>
References:  <bug-264238-21060@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264238

--- Comment #188 from J.R. Oldroyd <fbsd@opal.com> ---
Yes, the code has been there for ages.

However, in 2.10 additional CONFIG_XYZ options are enabled which result in =
the
generation of an IE that wasn't being generated before.  That IE is (correc=
tly
or incorrectly) being handed to our driver which is then incorrectly setting
WPA as a result of the IE.

Here is another proposed patch.

I have taken the approach that, if the driver receives an IE, whether or no=
t it
should have received it, it should process the IE properly.  At the moment =
the
driver just says "hey, we have an IE, so lets enable WPA".  If the IE is the
generated WLAN_EID_EXT_CAPAB IE, it is not the correct behavior to enable W=
PA.=20
So in this proposed patch, I am checking to see if the IE is WLAN_EID_RSN o=
r at
least not WLAN_EID_EXT_CAPAB and only setting WPA in the appropriate case.

diff --git a/contrib/wpa/src/drivers/driver_bsd.c
b/contrib/wpa/src/drivers/driver_bsd.c
index c455bc93103..8ead569c2ff 100644
--- a/contrib/wpa/src/drivers/driver_bsd.c
+++ b/contrib/wpa/src/drivers/driver_bsd.c
@@ -1257,19 +1257,22 @@ wpa_driver_bsd_associate(void *priv, struct
wpa_driver_associate_params *params)
        if (wpa_driver_bsd_set_auth_alg(drv, params->auth_alg) < 0)
                ret =3D -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_l=
en)
< 0)
+       if (params->wpa_ie_len && params->wpa_ie[0] =3D=3D WLAN_EID_RSN &&
+           wpa_driver_bsd_set_wpa_ie(drv, params->wpa_ie, params->wpa_ie_l=
en)
< 0)
                return -1;

        privacy =3D !(params->pairwise_suite =3D=3D WPA_CIPHER_NONE &&
            params->group_suite =3D=3D WPA_CIPHER_NONE &&
            params->key_mgmt_suite =3D=3D WPA_KEY_MGMT_NONE &&
-           params->wpa_ie_len =3D=3D 0);
+           (params->wpa_ie_len =3D=3D 0 || params->wpa_ie[0] !=3D WLAN_EID=
_RSN)
+           );
        wpa_printf(MSG_DEBUG, "%s: set PRIVACY %u", __func__, privacy);

        if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0)
                return -1;

        if (params->wpa_ie_len &&
+           params->wpa_ie[0] !=3D WLAN_EID_EXT_CAPAB &&
            set80211param(drv, IEEE80211_IOC_WPA,
                          params->wpa_ie[0] =3D=3D WLAN_EID_RSN ? 2 : 1) < =
0)
                return -1;

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-264238-21060-nfq8GXQOlU>