aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2020-04-19 23:40:01 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2020-04-21 22:15:13 +0200
commit3e6ba29ee5d20b0c4128d3a3faf10663bfed633a (patch)
tree0f60a8adba610142b7daef91e58dcaa6620f8d65
parentc89a3f0e275e1bb78bfdd66aa9529c60800fc9bd (diff)
downloadbackports-3e6ba29ee5d20b0c4128d3a3faf10663bfed633a.tar.gz
backports: genetlink: Add genlmsg_parse()
This adds the genlmsg_parse() function to the netlink backport. This was added in upstream commit 8cb081746c03 ("netlink: make validation more configurable for future strictness"). This function is used by the mac80211_hwsim driver. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/net/genetlink.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
index 747b6dac..326b9992 100644
--- a/backport/backport-include/net/genetlink.h
+++ b/backport/backport-include/net/genetlink.h
@@ -249,6 +249,17 @@ static inline struct nlattr **genl_family_attrbuf(struct genl_family *family)
return family->attrbuf;
}
-#endif /* LINUX_VERSION_IS_LESS(4,20,0) */
+
+#define genlmsg_parse LINUX_BACKPORT(genlmsg_parse)
+static inline int genlmsg_parse(const struct nlmsghdr *nlh,
+ const struct genl_family *family,
+ struct nlattr *tb[], int maxtype,
+ const struct nla_policy *policy,
+ struct netlink_ext_ack *extack)
+{
+ return __nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype,
+ policy, NL_VALIDATE_STRICT, extack);
+}
+#endif /* LINUX_VERSION_IS_LESS(5,2,0) */
#endif /* __BACKPORT_NET_GENETLINK_H */