diff mbox series

[5/7] header: Add NL_SET_BAD_ATTR

Message ID 20180917213142.7875-5-hauke@hauke-m.de (mailing list archive)
State Accepted
Headers show
Series [1/7] backports: Remove unused parts | expand

Commit Message

Hauke Mehrtens Sept. 17, 2018, 9:31 p.m. UTC
This is  used by the mac80211_hwsim driver. The code was copied from the
mainline kernel.
This was introduced in mainline kernel commit c3ab2b4ec8f7 ("net: ipv4:
Add extack messages for route add failures")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/netlink.h | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/backport/backport-include/linux/netlink.h b/backport/backport-include/linux/netlink.h
index 7da31aad..468a12d1 100644
--- a/backport/backport-include/linux/netlink.h
+++ b/backport/backport-include/linux/netlink.h
@@ -32,4 +32,11 @@  struct netlink_ext_ack {
 #define NETLINK_CB_PORTID(__skb) NETLINK_CB(__skb).portid
 #endif
 
+#ifndef NL_SET_BAD_ATTR
+#define NL_SET_BAD_ATTR(extack, attr) do {		\
+	if ((extack))					\
+		(extack)->bad_attr = (attr);		\
+} while (0)
+#endif /* NL_SET_BAD_ATTR */
+
 #endif /* __BACKPORT_LINUX_NETLINK_H */