summaryrefslogtreecommitdiff
path: root/backport/backport-include/net/genetlink.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-04-21 12:36:12 +0200
committerJohannes Berg <johannes.berg@intel.com>2017-04-26 15:57:37 +0200
commite8ec27f6c9c5554afa00d55b663d81e0b0cebaed (patch)
treec0f39c30eb884cbc0338bbeafa182cfb536cd817 /backport/backport-include/net/genetlink.h
parentd670f4a00e77d2cc3d0e29be1caefc63599014e0 (diff)
backports: add the necessary backports for netlink extack
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport/backport-include/net/genetlink.h')
-rw-r--r--backport/backport-include/net/genetlink.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
index 4b31d73f..b655d243 100644
--- a/backport/backport-include/net/genetlink.h
+++ b/backport/backport-include/net/genetlink.h
@@ -3,6 +3,30 @@
#include_next <net/genetlink.h>
#include <linux/version.h>
+#if LINUX_VERSION_IS_LESS(4,12,0)
+#define GENL_SET_ERR_MSG(info, msg) do { } while (0)
+
+static inline int genl_err_attr(struct genl_info *info, int err,
+ struct nlattr *attr)
+{
+#if LINUX_VERSION_IS_GEQ(4,12,0)
+ info->extack->bad_attr = attr;
+#endif
+
+ return err;
+}
+#endif
+
+/* this is for patches we apply */
+static inline struct netlink_ext_ack *genl_info_extack(struct genl_info *info)
+{
+#if LINUX_VERSION_IS_GEQ(4,12,0)
+ return info->extack;
+#else
+ return NULL;
+#endif
+}
+
/* this is for patches we apply */
#if LINUX_VERSION_IS_LESS(3,7,0)
#define genl_info_snd_portid(__genl_info) (__genl_info->snd_pid)