diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-08-29 15:47:30 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-08-30 00:14:58 -0700 |
commit | e458eb326dd35c42cd3da8e246ead98c909daa07 (patch) | |
tree | fce4056f7262f545b13b3073d5779acdb729e24e | |
parent | ad8363470ed6f62872523fe5fef551a98f9cda30 (diff) | |
download | meta-openembedded-e458eb326dd35c42cd3da8e246ead98c909daa07.tar.gz |
fping: Fix build with musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-networking/recipes-support/fping/fping/0001-fping-Initialize-msghdr-struct-in-a-portable-way.patch | 42 | ||||
-rw-r--r-- | meta-networking/recipes-support/fping/fping_5.1.bb | 4 |
2 files changed, 45 insertions, 1 deletions
diff --git a/meta-networking/recipes-support/fping/fping/0001-fping-Initialize-msghdr-struct-in-a-portable-way.patch b/meta-networking/recipes-support/fping/fping/0001-fping-Initialize-msghdr-struct-in-a-portable-way.patch new file mode 100644 index 000000000..2a5b3e619 --- /dev/null +++ b/meta-networking/recipes-support/fping/fping/0001-fping-Initialize-msghdr-struct-in-a-portable-way.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From c3f476a763412be51b4df0e748af04d4150a2c71 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 29 Aug 2022 15:41:51 -0700 | ||
4 | Subject: [PATCH] fping: Initialize msghdr struct in a portable way | ||
5 | |||
6 | Initializing the structure assuming glibc layout results in | ||
7 | compile errors on musl, therefore do partial intialization and then | ||
8 | assigning the members individually. | ||
9 | |||
10 | Upstream-status: Submitted [https://github.com/schweikert/fping/pull/263] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | src/fping.c | 16 +++++++--------- | ||
14 | 1 file changed, 7 insertions(+), 9 deletions(-) | ||
15 | |||
16 | diff --git a/src/fping.c b/src/fping.c | ||
17 | index e26b216..81a61d9 100644 | ||
18 | --- a/src/fping.c | ||
19 | +++ b/src/fping.c | ||
20 | @@ -1951,15 +1951,13 @@ int receive_packet(int64_t wait_time, | ||
21 | reply_buf, | ||
22 | reply_buf_len | ||
23 | }; | ||
24 | - struct msghdr recv_msghdr = { | ||
25 | - reply_src_addr, | ||
26 | - reply_src_addr_len, | ||
27 | - &msg_iov, | ||
28 | - 1, | ||
29 | - &msg_control, | ||
30 | - sizeof(msg_control), | ||
31 | - 0 | ||
32 | - }; | ||
33 | + struct msghdr recv_msghdr = {0}; | ||
34 | + recv_msghdr.msg_name = reply_src_addr; | ||
35 | + recv_msghdr.msg_namelen = reply_src_addr_len; | ||
36 | + recv_msghdr.msg_iov = &msg_iov; | ||
37 | + recv_msghdr.msg_iovlen = 1; | ||
38 | + recv_msghdr.msg_control = &msg_control; | ||
39 | + recv_msghdr.msg_controllen = sizeof(msg_control); | ||
40 | #if HAVE_SO_TIMESTAMPNS | ||
41 | struct cmsghdr* cmsg; | ||
42 | #endif | ||
diff --git a/meta-networking/recipes-support/fping/fping_5.1.bb b/meta-networking/recipes-support/fping/fping_5.1.bb index f2dd89756..0682eafa0 100644 --- a/meta-networking/recipes-support/fping/fping_5.1.bb +++ b/meta-networking/recipes-support/fping/fping_5.1.bb | |||
@@ -14,7 +14,9 @@ LICENSE = "fping" | |||
14 | NO_GENERIC_LICENSE[fping] = "COPYING" | 14 | NO_GENERIC_LICENSE[fping] = "COPYING" |
15 | LIC_FILES_CHKSUM = "file://COPYING;md5=c6170fbadddfcd74f011515291d96901" | 15 | LIC_FILES_CHKSUM = "file://COPYING;md5=c6170fbadddfcd74f011515291d96901" |
16 | 16 | ||
17 | SRC_URI = "http://www.fping.org/dist/fping-${PV}.tar.gz" | 17 | SRC_URI = "http://www.fping.org/dist/fping-${PV}.tar.gz \ |
18 | file://0001-fping-Initialize-msghdr-struct-in-a-portable-way.patch \ | ||
19 | " | ||
18 | SRC_URI[sha256sum] = "1ee5268c063d76646af2b4426052e7d81a42b657e6a77d8e7d3d2e60fd7409fe" | 20 | SRC_URI[sha256sum] = "1ee5268c063d76646af2b4426052e7d81a42b657e6a77d8e7d3d2e60fd7409fe" |
19 | 21 | ||
20 | S = "${WORKDIR}/fping-${PV}" | 22 | S = "${WORKDIR}/fping-${PV}" |