netlink: Workaround missing NETLINK_EXT_ACK define
RFC PATCH 1/2 netlink: Workaround missing NETLINK_EXT_ACK define
This works around the missing NETLINK_EXT_ACK define of really really old kernel version and defines the missing enum nlmsgerr_attrs.
--- ell/netlink-private.h | 9 +++++++++ 1 file changed, 9 insertions(+)
ell/netlink-private.h +9 -0
@@ -20,6 +20,15 @@#define NLA_DATA (nla) ((void*)(((char*)(nla)) + NLA_LENGTH(0)))#define NLA_PAYLOAD (nla) ((int)((nla)->nla_len) - NLA_LENGTH(0)) +#ifndef NETLINK_EXT_ACK +#define NETLINK_EXT_ACK 11 +enum nlmsgerr_attrs { +NLMSGERR_ATTR_UNUSED , +NLMSGERR_ATTR_MSG , +NLMSGERR_ATTR_OFFS , +}; +#endif +bool netlink_parse_ext_ack_error (const struct nlmsghdr *nlmsg,const char **out_error_msg,uint32_t *out_error_offset);
Signature · 1 line
2.41.0
Hi,
Quoted 5 lines
This works around the missing
NETLINK_EXT_ACKdefine of really really old kernel version and defines the missing enumnlmsgerr_attrs.
---ell/netlink-private.h| 9 +++++++++1 file changed, 9 insertions(+)
I applied this patch since it is simple and removes one compile obstacle for older systems.
Regards
Marcel