Skip to content

Commit b2d9055

Browse files
committed
net/linux/addrs: fix netlink kernel warnings
netlink: 4 bytes leftover after parsing attributes in process 'baresip'.
1 parent 6983845 commit b2d9055

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/net/linux/addrs.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ int net_netlink_addrs(net_ifaddr_h *ifh, void *arg)
149149

150150
struct {
151151
struct nlmsghdr nlh;
152-
struct ifaddrmsg ifa;
152+
union {
153+
struct ifinfomsg ifi;
154+
struct ifaddrmsg ifa;
155+
} u;
153156
} req;
154157

155158
if (!ifh)
@@ -166,7 +169,7 @@ int net_netlink_addrs(net_ifaddr_h *ifh, void *arg)
166169

167170
/* GETLINK */
168171
memset(&req, 0, sizeof(req));
169-
req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
172+
req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
170173
req.nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
171174
req.nlh.nlmsg_type = RTM_GETLINK;
172175

0 commit comments

Comments
 (0)