From 8be51b7c3520fd2dbd1ba2e917a499c90822817f Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 27 Jan 2026 10:46:19 +0100 Subject: [PATCH] Fix build for musl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit musl's struct msghdr includes padding members, so using undesignated initializers as was previously being done ended up initializing the wrong members: gcc -O -D_GNU_SOURCE -Wall -Wno-parentheses -DHAVE_CONFIG_H -I. -I. -c -o xio-netlink.o xio-netlink.c xio-netlink.c: In function ‘xio_netlink_mtu’: xio-netlink.c:33:59: error: initialization of ‘int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion] 33 | ct msghdr rtmsg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; | ^~~~ xio-netlink.c:33:59: note: (near initialization for ‘rtmsg.__pad1’) make: *** [: xio-netlink.o] Error 1 --- xio-netlink.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xio-netlink.c b/xio-netlink.c index 533d78c..b0c5c3c 100644 --- a/xio-netlink.c +++ b/xio-netlink.c @@ -30,7 +30,12 @@ int xio_netlink_mtu( struct nlmsghdr buf[8192/sizeof(struct nlmsghdr)]; struct iovec iov = { buf, sizeof(buf) }; struct sockaddr_nl sa; - struct msghdr rtmsg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; + struct msghdr rtmsg = { + .msg_name = &sa, + .msg_namelen = sizeof(sa), + .msg_iov = &iov, + .msg_iovlen = 1, + }; struct nlmsghdr *nh; Info2("Setting interface %d MTU to %u using netlink", interface_index, mtu); base-commit: 8834d6cc7e0d7b04cd31f9f7d0cb3e06913b0323 -- 2.52.0