From e4a1e68d7ab318caa50312c022bd22a8fb81c6b7 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 30 Nov 2019 15:01:06 +0900 Subject: sd-netlink: support NLMSGERR_ATTR_MSG From v4.12 the kernel appends some attributes to netlink acks containing a textual description of the error and other fields. This makes sd-netlink parse the attributes. --- src/libsystemd/sd-netlink/sd-netlink.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libsystemd/sd-netlink/sd-netlink.c') diff --git a/src/libsystemd/sd-netlink/sd-netlink.c b/src/libsystemd/sd-netlink/sd-netlink.c index 87350e8591..5b7081089e 100644 --- a/src/libsystemd/sd-netlink/sd-netlink.c +++ b/src/libsystemd/sd-netlink/sd-netlink.c @@ -107,6 +107,10 @@ int sd_netlink_open_fd(sd_netlink **ret, int fd) { rtnl->fd = fd; rtnl->protocol = protocol; + r = setsockopt_int(fd, SOL_NETLINK, NETLINK_EXT_ACK, 1); + if (r < 0) + log_debug_errno(r, "sd-netlink: Failed to enable NETLINK_EXT_ACK option, ignoring: %m"); + r = socket_bind(rtnl); if (r < 0) { rtnl->fd = -1; /* on failure, the caller remains owner of the fd, hence don't close it here */ -- cgit v1.2.1