From 0812d31deabe32918fd5b9498f0a8b2c2962d70b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 29 Mar 2015 04:35:17 +0200 Subject: [PATCH] ra: use proper struct msghdr initializer to fix build error on musl Signed-off-by: Felix Fietkau --- src/ra.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ra.c b/src/ra.c index 90f0923..9541624 100644 --- 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) -- 2.25.1