diff mbox series

[RFC,1/2] netlink: Workaround missing NETLINK_EXT_ACK define

Message ID 20231111180753.51488-1-marcel@holtmann.org (mailing list archive)
State New
Headers show
Series [RFC,1/2] netlink: Workaround missing NETLINK_EXT_ACK define | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-ci-makecheck success Make Check
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-ci-testrunner fail test-runner - FAIL: testDPP

Commit Message

Marcel Holtmann Nov. 11, 2023, 6:07 p.m. UTC
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(+)

Comments

Marcel Holtmann Nov. 19, 2023, 4:49 p.m. UTC | #1
Hi,

> 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(+)

I applied this patch since it is simple and removes one compile obstacle for older systems.

Regards

Marcel
diff mbox series

Patch

diff --git a/ell/netlink-private.h b/ell/netlink-private.h
index 229b1d442ad8..0a1b016d8887 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);