diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-11-21 12:59:41 +0000 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-12-22 09:40:23 +0000 |
commit | e34cb44ac7c08783b98a16eec70125e205e6eb12 (patch) | |
tree | 1101d23f1a73e5627ae187b07c7a0cf8826e10d1 /backport-include/linux/netlink.h |
initial commit
Generated againts 4.14 kernel source with
git backports 1d8cc151d365582b42be00af776270b834a7a37d
Diffstat (limited to 'backport-include/linux/netlink.h')
-rw-r--r-- | backport-include/linux/netlink.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/backport-include/linux/netlink.h b/backport-include/linux/netlink.h new file mode 100644 index 0000000..7da31aa --- /dev/null +++ b/backport-include/linux/netlink.h @@ -0,0 +1,35 @@ +#ifndef __BACKPORT_LINUX_NETLINK_H +#define __BACKPORT_LINUX_NETLINK_H +#include_next <linux/netlink.h> +#include <linux/version.h> + +#if LINUX_VERSION_IS_LESS(4,12,0) +#define NETLINK_MAX_COOKIE_LEN 20 + +struct netlink_ext_ack { + const char *_msg; + const struct nlattr *bad_attr; + u8 cookie[NETLINK_MAX_COOKIE_LEN]; + u8 cookie_len; + + /* backport only field */ + void *__bp_genl_real_ops; +}; + +#define NL_SET_ERR_MSG(extack, msg) do { \ + static const char _msg[] = (msg); \ + \ + (extack)->_msg = _msg; \ +} while (0) +#endif + +/* this is for patches we apply */ +#if LINUX_VERSION_IS_LESS(3,7,0) +#define netlink_notify_portid(__notify) (__notify->pid) +#define NETLINK_CB_PORTID(__skb) NETLINK_CB(__skb).pid +#else +#define netlink_notify_portid(__notify) (__notify->portid) +#define NETLINK_CB_PORTID(__skb) NETLINK_CB(__skb).portid +#endif + +#endif /* __BACKPORT_LINUX_NETLINK_H */ |