Commit 3d124ea2 authored by Jouni Malinen's avatar Jouni Malinen Committed by Johannes Berg

cfg80211: fix VHT TDLS peer AID verification

I (Johannes) accidentally applied the first version of the patch
("Allow TDLS peer AID to be configured for VHT"). Now apply just
the changes between v1 and v2 to get the AID verification and
prefer the new attribute over the old one.
Signed-off-by: default avatarJouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent ffb3cf30
...@@ -3972,10 +3972,10 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) ...@@ -3972,10 +3972,10 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
params.listen_interval = params.listen_interval =
nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]); nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]);
if (info->attrs[NL80211_ATTR_STA_AID]) if (info->attrs[NL80211_ATTR_PEER_AID])
params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]);
else
params.aid = nla_get_u16(info->attrs[NL80211_ATTR_PEER_AID]); params.aid = nla_get_u16(info->attrs[NL80211_ATTR_PEER_AID]);
else
params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]);
if (!params.aid || params.aid > IEEE80211_MAX_AID) if (!params.aid || params.aid > IEEE80211_MAX_AID)
return -EINVAL; return -EINVAL;
...@@ -4027,7 +4027,8 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) ...@@ -4027,7 +4027,8 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
params.sta_modify_mask &= ~STATION_PARAM_APPLY_UAPSD; params.sta_modify_mask &= ~STATION_PARAM_APPLY_UAPSD;
/* TDLS peers cannot be added */ /* TDLS peers cannot be added */
if (params.sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) if ((params.sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) ||
info->attrs[NL80211_ATTR_PEER_AID])
return -EINVAL; return -EINVAL;
/* but don't bother the driver with it */ /* but don't bother the driver with it */
params.sta_flags_mask &= ~BIT(NL80211_STA_FLAG_TDLS_PEER); params.sta_flags_mask &= ~BIT(NL80211_STA_FLAG_TDLS_PEER);
...@@ -4053,7 +4054,8 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) ...@@ -4053,7 +4054,8 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
if (params.sta_flags_mask & BIT(NL80211_STA_FLAG_ASSOCIATED)) if (params.sta_flags_mask & BIT(NL80211_STA_FLAG_ASSOCIATED))
return -EINVAL; return -EINVAL;
/* TDLS peers cannot be added */ /* TDLS peers cannot be added */
if (params.sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) if ((params.sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) ||
info->attrs[NL80211_ATTR_PEER_AID])
return -EINVAL; return -EINVAL;
break; break;
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment