From: Steven Barth Date: Tue, 18 Nov 2014 09:36:06 +0000 (+0100) Subject: Fix msghdr initialization on musl X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7e6eebbe7d3df2b86b36b2e0d6ae7ee65f642094;p=oweals%2Fodhcp6c.git Fix msghdr initialization on musl --- diff --git a/src/dhcpv6.c b/src/dhcpv6.c index ca41db6..1af5c9a 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -464,7 +464,8 @@ static void dhcpv6_send(enum dhcpv6_msg type, uint8_t trid[3], uint32_t ecs) struct sockaddr_in6 srv = {AF_INET6, htons(DHCPV6_SERVER_PORT), 0, ALL_DHCPV6_RELAYS, ifindex}; - struct msghdr msg = {&srv, sizeof(srv), iov, cnt, NULL, 0, 0}; + struct msghdr msg = {.msg_name = &srv, .msg_namelen = sizeof(srv), + .msg_iov = iov, .msg_iovlen = cnt}; sendmsg(sock, &msg, 0); } @@ -552,8 +553,9 @@ int dhcpv6_request(enum dhcpv6_msg type) uint8_t buf[1536], cmsg_buf[CMSG_SPACE(sizeof(struct in6_pktinfo))]; struct iovec iov = {buf, sizeof(buf)}; struct sockaddr_in6 addr; - struct msghdr msg = {&addr, sizeof(addr), &iov, 1, - cmsg_buf, sizeof(cmsg_buf), 0}; + struct msghdr msg = {.msg_name = &addr, .msg_namelen = sizeof(addr), + .msg_iov = &iov, .msg_iovlen = 1, .msg_control = cmsg_buf, + .msg_controllen = sizeof(cmsg_buf)}; struct in6_pktinfo *pktinfo = NULL;