ra: use proper struct msghdr initializer to fix build error on musl
authorFelix Fietkau <nbd@openwrt.org>
Sun, 29 Mar 2015 02:35:17 +0000 (04:35 +0200)
committerSteven Barth <steven@midlink.org>
Sun, 29 Mar 2015 11:55:32 +0000 (13:55 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
src/ra.c

index 90f09230d6f7ce6a5976814b9cfeae311dec53aa..95416240b2113fa313aa35bf2b55fcca4f69575c 100644 (file)
--- a/src/ra.c
+++ b/src/ra.c
@@ -271,8 +271,15 @@ bool ra_process(void)
        while (true) {
                struct sockaddr_in6 from;
                struct iovec iov = {buf, sizeof(buf)};
-               struct msghdr msg = {&from, sizeof(from), &iov, 1,
-                               cmsg_buf, sizeof(cmsg_buf), 0};
+               struct msghdr msg = {
+                       .msg_name = (void *) &from,
+                       .msg_namelen = sizeof(from),
+                       .msg_iov = &iov,
+                       .msg_iovlen = 1,
+                       .msg_control = cmsg_buf,
+                       .msg_controllen = sizeof(cmsg_buf),
+                       .msg_flags = 0
+               };
 
                ssize_t len = recvmsg(sock, &msg, MSG_DONTWAIT);
                if (len <= 0)