[PATCH 3/9] backports: genetlink: Add genlmsg_parse()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 backport/backport-include/net/genetlink.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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 */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux