1 From: Szabolcs Nagy <nsz@port70.net>
2 Date: Sun, 24 Apr 2016 17:39:02 +0200
3 Subject: [PATCH] ip: fix problem on mips64 n64 big endian musl systems
5 Use designated initializers for struct msghdr.
6 The struct layout is non-portable and musl libc does not match what busybox expects.
8 Signed-off-by: Szabolcs Nagy <nsz@port70.net>
9 Tested-by: Waldemar Brodkorb <wbx@openadk.org>
10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 --- a/networking/libiproute/libnetlink.c
14 +++ b/networking/libiproute/libnetlink.c
15 @@ -71,11 +71,15 @@ int FAST_FUNC rtnl_dump_request(struct r
17 struct sockaddr_nl nladdr;
18 struct iovec iov[2] = { { &nlh, sizeof(nlh) }, { req, len } };
19 + /* Use designated initializers, struct layout is non-portable */
21 - (void*)&nladdr, sizeof(nladdr),
25 + .msg_name = (void*)&nladdr,
26 + .msg_namelen = sizeof(nladdr),
29 + .msg_control = NULL,
30 + .msg_controllen = 0,
34 memset(&nladdr, 0, sizeof(nladdr));
35 @@ -104,12 +108,15 @@ static int rtnl_dump_filter(struct rtnl_
40 + /* Use designated initializers, struct layout is non-portable */
42 - (void*)&nladdr, sizeof(nladdr),
46 + .msg_name = (void*)&nladdr,
47 + .msg_namelen = sizeof(nladdr),
50 + .msg_control = NULL,
51 + .msg_controllen = 0,
55 status = recvmsg(rth->fd, &msg, 0);
56 @@ -211,11 +218,15 @@ int FAST_FUNC rtnl_talk(struct rtnl_hand
57 struct sockaddr_nl nladdr;
58 struct iovec iov = { (void*)n, n->nlmsg_len };
59 char *buf = xmalloc(8*1024); /* avoid big stack buffer */
60 + /* Use designated initializers, struct layout is non-portable */
62 - (void*)&nladdr, sizeof(nladdr),
66 + .msg_name = (void*)&nladdr,
67 + .msg_namelen = sizeof(nladdr),
70 + .msg_control = NULL,
71 + .msg_controllen = 0,
75 memset(&nladdr, 0, sizeof(nladdr));