Skip to content

Commit 6c8b6e4

Browse files
Rajkumar Manoharanjmberg-intel
Rajkumar Manoharan
authored andcommitted
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: 796e90f ("cfg80211: add support for parsing OBBS_PD attributes") Signed-off-by: Rajkumar Manoharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 21439b6 commit 6c8b6e4

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

net/wireless/nl80211.c

+8-10
Original file line numberDiff line numberDiff line change
@@ -4857,16 +4857,14 @@ static int nl80211_parse_he_obss_pd(struct nlattr *attrs,
48574857
if (err)
48584858
return err;
48594859

4860-
if (!tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET] ||
4861-
!tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET])
4862-
return -EINVAL;
4863-
4864-
he_obss_pd->min_offset =
4865-
nla_get_u32(tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET]);
4866-
he_obss_pd->max_offset =
4867-
nla_get_u32(tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET]);
4868-
4869-
if (he_obss_pd->min_offset >= he_obss_pd->max_offset)
4860+
if (tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET])
4861+
he_obss_pd->min_offset =
4862+
nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET]);
4863+
if (tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET])
4864+
he_obss_pd->max_offset =
4865+
nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET]);
4866+
4867+
if (he_obss_pd->min_offset > he_obss_pd->max_offset)
48704868
return -EINVAL;
48714869

48724870
he_obss_pd->enable = true;

0 commit comments

Comments
 (0)