diff --git a/src/drivers/driver.h b/src/drivers/driver.h index f382d231b..94006ac0c 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1124,6 +1124,7 @@ struct hostapd_sta_add_params { int vht_opmode_enabled; u8 vht_opmode; u32 flags; /* bitmask of WPA_STA_* flags */ + u32 flags_mask; /* unset bits in flags */ int set; /* Set STA parameters instead of add */ u8 qosinfo; const u8 *ext_capab; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 70d6c30ee..0e4fac721 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -7764,8 +7764,8 @@ static int wpa_driver_nl80211_sta_add(void *priv, } os_memset(&upd, 0, sizeof(upd)); - upd.mask = sta_flags_nl80211(params->flags); - upd.set = upd.mask; + upd.set = sta_flags_nl80211(params->flags); + upd.mask = upd.set | sta_flags_nl80211(params->flags_mask); wpa_printf(MSG_DEBUG, " * flags set=0x%x mask=0x%x", upd.set, upd.mask); NLA_PUT(msg, NL80211_ATTR_STA_FLAGS2, sizeof(upd), &upd);