mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 21:54:11 +08:00
nl80211: fix OBSS PD min and max offset validation
The SRG min and max offset won't present when SRG Information Present of
SR control field of Spatial Reuse Parameter Set element set to 0. Per
spec. IEEE802.11ax D7.0, SRG OBSS PD Min Offset ≤ SRG OBSS PD Max
Offset. Hence fix the constrain check to allow same values in both
offset and also call appropriate nla_get function to read the values.
Fixes: 796e90f42b
("cfg80211: add support for parsing OBBS_PD attributes")
Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Link: https://lore.kernel.org/r/1601278091-20313-1-git-send-email-rmanohar@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
21439b652b
commit
6c8b6e4a5f
@ -4857,16 +4857,14 @@ static int nl80211_parse_he_obss_pd(struct nlattr *attrs,
|
|||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
if (!tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET] ||
|
if (tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET])
|
||||||
!tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET])
|
he_obss_pd->min_offset =
|
||||||
return -EINVAL;
|
nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET]);
|
||||||
|
if (tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET])
|
||||||
|
he_obss_pd->max_offset =
|
||||||
|
nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET]);
|
||||||
|
|
||||||
he_obss_pd->min_offset =
|
if (he_obss_pd->min_offset > he_obss_pd->max_offset)
|
||||||
nla_get_u32(tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET]);
|
|
||||||
he_obss_pd->max_offset =
|
|
||||||
nla_get_u32(tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET]);
|
|
||||||
|
|
||||||
if (he_obss_pd->min_offset >= he_obss_pd->max_offset)
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
he_obss_pd->enable = true;
|
he_obss_pd->enable = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user