aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2023-11-11 19:07:52 +0100
committerMarcel Holtmann <marcel@holtmann.org>2023-11-19 17:48:20 +0100
commitc1bac85dc1a78983410fc534584ccc0bfdc22557 (patch)
treee35f95a3c4199a9a17af6ea55ba4204efa08f2c4
parent95e7f719b01c95c6a142c9380e14e9a3fd3598d1 (diff)
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.
-rw-r--r--ell/netlink-private.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ell/netlink-private.h b/ell/netlink-private.h
index 229b1d44..0a1b016d 100644
--- a/ell/netlink-private.h
+++ b/ell/netlink-private.h
@@ -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);