diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2019-08-02 21:58:00 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2019-08-14 20:15:48 +0200 |
commit | 70c90463ff26b759fddf6e5decc6bf6ae6136776 (patch) | |
tree | d5596ad7bd4752e54069e7d1f9f0cfc1102653a0 | |
parent | 635b9c9b181cd14b3c8a9eb5c4ebeafff9afe8de (diff) |
header: Add nl80211_validate_nested()
nl80211_validate_nested() was added in commit 901bb9891855 ("nl80211:
require and validate vendor command policy") in kernel 5.3 and is used
by nl80211.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/net/netlink.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h index 4d73c57f..b2045e44 100644 --- a/backport/backport-include/net/netlink.h +++ b/backport/backport-include/net/netlink.h @@ -266,6 +266,18 @@ nla_validate_nested_deprecated(const struct nlattr *start, int maxtype, } #endif /* < 5.2 */ +#if LINUX_VERSION_IS_LESS(5,3,0) +#define nl80211_validate_nested LINUX_BACKPORT(nl80211_validate_nested) +static inline int +nl80211_validate_nested(const struct nlattr *start, int maxtype, + const struct nla_policy *policy, + struct netlink_ext_ack *extack) +{ + return __nla_validate_nested(start, maxtype, policy, + NL_VALIDATE_STRICT, extack); +} +#endif /* < 5.3 */ + #if LINUX_VERSION_IS_LESS(5,1,0) #undef NLA_POLICY_NESTED #undef NLA_POLICY_NESTED_ARRAY |