Skip to content

Commit

Permalink
staging: rtl8723bs: fix wpa_set_auth_algs() function
Browse files Browse the repository at this point in the history
commit b658acb upstream.

fix authentication algorithm constants.
wpa_set_auth_algs() function contains some conditional
statements masking the checked value with the wrong
constants. This produces some unintentional dead code.
Mask the value with the right macros.

Fixes: 5befa93 ("staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants.")
Reported-by: Colin Ian King <colin.king@canonical.com>
Tested-on: Lenovo Ideapad MiiX 300-10IBY
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/20210715145700.9427-1-fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
fabioaiuto authored and gregkh committed Sep 26, 2021
1 parent 24a026e commit 8843c3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
Expand Up @@ -349,16 +349,16 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value)
struct adapter *padapter = rtw_netdev_priv(dev);
int ret = 0;

if ((value & WLAN_AUTH_SHARED_KEY) && (value & WLAN_AUTH_OPEN)) {
if ((value & IW_AUTH_ALG_SHARED_KEY) && (value & IW_AUTH_ALG_OPEN_SYSTEM)) {
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeAutoSwitch;
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
} else if (value & WLAN_AUTH_SHARED_KEY) {
} else if (value & IW_AUTH_ALG_SHARED_KEY) {
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;

padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeShared;
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
} else if (value & WLAN_AUTH_OPEN) {
} else if (value & IW_AUTH_ALG_OPEN_SYSTEM) {
/* padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; */
if (padapter->securitypriv.ndisauthtype < Ndis802_11AuthModeWPAPSK) {
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
Expand Down

0 comments on commit 8843c3d

Please sign in to comment.