* [PATCH v2] patches: Avoid NLA_POLICY_RANGE() for NL80211_ATTR_EHT_CAPABILITY
@ 2023-02-22 5:01 Aloka Dixit
2023-08-17 18:09 ` Aloka Dixit
0 siblings, 1 reply; 2+ messages in thread
From: Aloka Dixit @ 2023-02-22 5:01 UTC (permalink / raw)
To: hauke, mcgrof; +Cc: backports, Aloka Dixit
NLA_POLICY_RANGE(NLA_BINARY, ...) is not supported on kernels < 5.10.
Avoid its use in older kernels for NL80211_ATTR_EHT_CAPABILITY
which was added in following commit,
commit ea05fd3581d3 ("cfg80211: Support configuration of station EHT
capabilities")
Author: Ilan Peer <ilan.peer@intel.com>
Date: Mon Feb 14 17:29:58 2022 +0100
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
v2: Removed the modification of NL80211_ATTR_HE_CAPABILITY which was
a rebasing error and not related to this commit.
patches/0099-netlink-range/mac80211.patch | 27 +++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/patches/0099-netlink-range/mac80211.patch b/patches/0099-netlink-range/mac80211.patch
index bc55cc2f15bd..ec4d1b9a08ca 100644
--- a/patches/0099-netlink-range/mac80211.patch
+++ b/patches/0099-netlink-range/mac80211.patch
@@ -1,6 +1,8 @@
+diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
+index 33a82ecab9d5..fecb5500dcf4 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -412,10 +412,15 @@ static const struct nla_policy
+@@ -421,10 +421,15 @@ static const struct nla_policy
nl80211_fils_discovery_policy[NL80211_FILS_DISCOVERY_ATTR_MAX + 1] = {
[NL80211_FILS_DISCOVERY_ATTR_INT_MIN] = NLA_POLICY_MAX(NLA_U32, 10000),
[NL80211_FILS_DISCOVERY_ATTR_INT_MAX] = NLA_POLICY_MAX(NLA_U32, 10000),
@@ -16,7 +18,7 @@
};
static const struct nla_policy
-@@ -510,7 +515,11 @@ static const struct nla_policy nl80211_p
+@@ -535,7 +540,11 @@ static const struct nla_policy nl80211_p
[NL80211_ATTR_MPATH_NEXT_HOP] = NLA_POLICY_ETH_ADDR_COMPAT,
/* allow 3 for NUL-termination, we used to declare this NLA_STRING */
@@ -28,7 +30,7 @@
[NL80211_ATTR_REG_RULES] = { .type = NLA_NESTED },
[NL80211_ATTR_BSS_CTS_PROT] = { .type = NLA_U8 },
-@@ -656,16 +665,26 @@ static const struct nla_policy nl80211_p
+@@ -681,16 +690,26 @@ static const struct nla_policy nl80211_p
* The value of the Length field of the Supported Operating
* Classes element is between 2 and 253.
*/
@@ -55,7 +57,7 @@
[NL80211_ATTR_MAC_HINT] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
[NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
[NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
-@@ -720,10 +739,15 @@ static const struct nla_policy nl80211_p
+@@ -745,9 +764,14 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
[NL80211_ATTR_TXQ_LIMIT] = { .type = NLA_U32 },
[NL80211_ATTR_TXQ_MEMORY_LIMIT] = { .type = NLA_U32 },
[NL80211_ATTR_TXQ_QUANTUM] = { .type = NLA_U32 },
@@ -71,3 +73,20 @@
[NL80211_ATTR_FTM_RESPONDER] =
NLA_POLICY_NESTED(nl80211_ftm_responder_policy),
[NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1),
+@@ -793,10 +817,16 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
+ [NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED },
+ [NL80211_ATTR_RADAR_BACKGROUND] = { .type = NLA_FLAG },
+ [NL80211_ATTR_AP_SETTINGS_FLAGS] = { .type = NLA_U32 },
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ [NL80211_ATTR_EHT_CAPABILITY] =
+ NLA_POLICY_RANGE(NLA_BINARY,
+ NL80211_EHT_MIN_CAPABILITY_LEN,
+ NL80211_EHT_MAX_CAPABILITY_LEN),
++#else
++ [NL80211_ATTR_EHT_CAPABILITY] =
++ { .type = NLA_BINARY,
++ .len = NL80211_EHT_MAX_CAPABILITY_LEN },
++#endif
+ [NL80211_ATTR_DISABLE_EHT] = { .type = NLA_FLAG },
+ [NL80211_ATTR_MLO_LINKS] =
+ NLA_POLICY_NESTED_ARRAY(nl80211_policy),
base-commit: dfe0f60ca8a1065e63b4db703b3bd2708ee23a0e
--
2.39.0
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] patches: Avoid NLA_POLICY_RANGE() for NL80211_ATTR_EHT_CAPABILITY
2023-02-22 5:01 [PATCH v2] patches: Avoid NLA_POLICY_RANGE() for NL80211_ATTR_EHT_CAPABILITY Aloka Dixit
@ 2023-08-17 18:09 ` Aloka Dixit
0 siblings, 0 replies; 2+ messages in thread
From: Aloka Dixit @ 2023-08-17 18:09 UTC (permalink / raw)
To: hauke, mcgrof; +Cc: backports
On 2/21/2023 9:01 PM, Aloka Dixit wrote:
> NLA_POLICY_RANGE(NLA_BINARY, ...) is not supported on kernels < 5.10.
> Avoid its use in older kernels for NL80211_ATTR_EHT_CAPABILITY
> which was added in following commit,
> commit ea05fd3581d3 ("cfg80211: Support configuration of station EHT
> capabilities")
> Author: Ilan Peer <ilan.peer@intel.com>
> Date: Mon Feb 14 17:29:58 2022 +0100
>
> Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
> ---
> v2: Removed the modification of NL80211_ATTR_HE_CAPABILITY which was
> a rebasing error and not related to this commit.
>
> patches/0099-netlink-range/mac80211.patch | 27 +++++++++++++++++++----
> 1 file changed, 23 insertions(+), 4 deletions(-)
>
Hello,
Kindly review this patch.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-17 18:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22 5:01 [PATCH v2] patches: Avoid NLA_POLICY_RANGE() for NL80211_ATTR_EHT_CAPABILITY Aloka Dixit
2023-08-17 18:09 ` Aloka Dixit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).