summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-01-06 14:18:00 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-24 09:40:29 +0000
commitea9dc990a98b40358ed60f1efbc7d0c2e4e2ca9e (patch)
tree1b1ccb0a509932d6de1294e2271a05d07cdf6679 /meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch
parentb207868cddcad850078fd061c4150c6ff92acbba (diff)
downloadpoky-ea9dc990a98b40358ed60f1efbc7d0c2e4e2ca9e.tar.gz
iputils: Use member based initialization for mrghdr struct
Fix build with musl uclibc and glibc dont agree on structure of the struct, musl rightly adds padding elements, so when doing anonymous initialization struct elements gets wrongly mapped on 64bit arches (From OE-Core rev: 3c54b18797eb26d2045fd506d2b0c8b996a0396c) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch')
-rw-r--r--meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch b/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch
new file mode 100644
index 0000000000..6da01dc616
--- /dev/null
+++ b/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch
@@ -0,0 +1,52 @@
1From 000629f74908a2a95f6104444c77ad93cf40d62d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 13 Jan 2016 08:50:50 +0000
4Subject: [PATCH] Intialize struct elements by name
5
6makes it portable across glibc and musl
7
8Fixes errors
9
10| ping.c: In function 'send_probe':
11| ping.c:735:19: warning: initialization makes integer from pointer
12without a cast [-Wint-conversion]
13| &iov, 1, &cmsg, 0, 0 };
14| ^
15| ping.c:735:19: note: (near initialization for 'm.__pad1')
16| ping.c:735:19: error: initializer element is not computable at load
17time
18| ping.c:735:19: note: (near initialization for 'm.__pad1')
19| make: *** [ping.o] Error 1
20
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22---
23Upstream-Status: Pending
24
25 ping.c | 11 +++++++++--
26 1 file changed, 9 insertions(+), 2 deletions(-)
27
28diff --git a/ping.c b/ping.c
29index 4989760..e67f381 100644
30--- a/ping.c
31+++ b/ping.c
32@@ -731,8 +731,15 @@ int send_probe()
33
34 do {
35 static struct iovec iov = {outpack, 0};
36- static struct msghdr m = { &whereto, sizeof(whereto),
37- &iov, 1, &cmsg, 0, 0 };
38+ static struct msghdr m = {
39+ .msg_name = &whereto,
40+ .msg_namelen = sizeof(whereto),
41+ .msg_iov = &iov,
42+ .msg_iovlen = 1,
43+ .msg_control = &cmsg,
44+ .msg_controllen = 0,
45+ .msg_flags= 0,
46+ };
47 m.msg_controllen = cmsg_len;
48 iov.iov_len = cc;
49
50--
512.7.0
52