aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2022-07-30 20:42:51 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2022-07-31 01:13:17 +0200
commit966cd6757a2541a157ce4a585eec71937a475e05 (patch)
tree6df0dbd304b965302eeb135cf182c0b286d86483
parentb13dda02bce5254c0e182e99b6abeb5d2522a75f (diff)
downloadbackports-966cd6757a2541a157ce4a585eec71937a475e05.tar.gz
patches: Avoid using NLA_POLICY_RANGE(NLA_BINARY, ...) in NL80211_ATTR_REG_ALPHA2
NLA_POLICY_RANGE(NLA_BINARY, ...) is not supported on kernel < 5.10, it is now used by NL80211_ATTR_REG_ALPHA2. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--patches/0099-netlink-range/mac80211.patch16
-rw-r--r--patches/0100-revert-small_ops/mac80211.patch4
2 files changed, 16 insertions, 4 deletions
diff --git a/patches/0099-netlink-range/mac80211.patch b/patches/0099-netlink-range/mac80211.patch
index 7b4b172c..bc55cc2f 100644
--- a/patches/0099-netlink-range/mac80211.patch
+++ b/patches/0099-netlink-range/mac80211.patch
@@ -16,7 +16,19 @@
};
static const struct nla_policy
-@@ -656,16 +661,26 @@ static const struct nla_policy nl80211_p
+@@ -510,7 +515,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 */
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ [NL80211_ATTR_REG_ALPHA2] = NLA_POLICY_RANGE(NLA_BINARY, 2, 3),
++#else
++ [NL80211_ATTR_REG_ALPHA2] = { .type = NLA_STRING, .len = 2 },
++#endif
+ [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
* The value of the Length field of the Supported Operating
* Classes element is between 2 and 253.
*/
@@ -43,7 +55,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 +735,15 @@ static const struct nla_policy nl80211_p
+@@ -720,10 +739,15 @@ static const struct nla_policy nl80211_p
[NL80211_ATTR_TXQ_LIMIT] = { .type = NLA_U32 },
[NL80211_ATTR_TXQ_MEMORY_LIMIT] = { .type = NLA_U32 },
[NL80211_ATTR_TXQ_QUANTUM] = { .type = NLA_U32 },
diff --git a/patches/0100-revert-small_ops/mac80211.patch b/patches/0100-revert-small_ops/mac80211.patch
index 9a64171c..1bae5a0b 100644
--- a/patches/0100-revert-small_ops/mac80211.patch
+++ b/patches/0100-revert-small_ops/mac80211.patch
@@ -1,6 +1,6 @@
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -15180,9 +15180,11 @@ static const struct genl_ops nl80211_ops
+@@ -15184,9 +15184,11 @@ static const struct genl_ops nl80211_ops
/* can be retrieved by unprivileged users */
.internal_flags = NL80211_FLAG_NEED_WIPHY,
},
@@ -12,7 +12,7 @@
{
.cmd = NL80211_CMD_SET_WIPHY,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
-@@ -15972,8 +15974,10 @@ static struct genl_family nl80211_fam __
+@@ -15976,8 +15978,10 @@ static struct genl_family nl80211_fam __
.module = THIS_MODULE,
.ops = nl80211_ops,
.n_ops = ARRAY_SIZE(nl80211_ops),