From 515176d152c55b964578fecb9c28533d069c6b3c Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 26 Dec 2024 10:46:58 +0100 Subject: [PATCH] net/linux/addrs: fix netlink kernel warnings (#1243) Fixes: netlink: 4 bytes leftover after parsing attributes in process 'baresip'. messages --- src/net/linux/addrs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/net/linux/addrs.c b/src/net/linux/addrs.c index 2d825f3df..a09294fd4 100644 --- a/src/net/linux/addrs.c +++ b/src/net/linux/addrs.c @@ -149,7 +149,10 @@ int net_netlink_addrs(net_ifaddr_h *ifh, void *arg) struct { struct nlmsghdr nlh; - struct ifaddrmsg ifa; + union { + struct ifinfomsg ifi; + struct ifaddrmsg ifa; + } u; } req; if (!ifh) @@ -166,7 +169,7 @@ int net_netlink_addrs(net_ifaddr_h *ifh, void *arg) /* GETLINK */ memset(&req, 0, sizeof(req)); - req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); + req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); req.nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; req.nlh.nlmsg_type = RTM_GETLINK;