summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-09-06 20:57:58 -0700
committerJoe MacDonald <joe_macdonald@mentor.com>2017-09-12 10:55:09 -0400
commita5a6d11d9e69a4e02984d5a87a35e71d3a6e9ffa (patch)
tree9502964123332a4ada22edfa77db95dc2b62cd86
parent30d389c2f11695686a72de4bb315b45eaa7564e8 (diff)
downloadmeta-openembedded-a5a6d11d9e69a4e02984d5a87a35e71d3a6e9ffa.tar.gz
ndisc6: Fix build with clang and update to latest on git
Change recipe to git and http protocol Pass PERL variable to configure Add patches to fix VLAIS Re-organize structure of recipe Copy gettext.h from native sysroot instead of depending on build host Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--meta-networking/recipes-support/ndisc6/ndisc6/0001-autogen-Do-not-symlink-gettext.h-from-build-host.patch34
-rw-r--r--meta-networking/recipes-support/ndisc6/ndisc6/0001-replace-VLAIS-with-malloc-free-pair.patch124
-rw-r--r--meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch30
-rw-r--r--meta-networking/recipes-support/ndisc6/ndisc6_git.bb (renamed from meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb)43
4 files changed, 220 insertions, 11 deletions
diff --git a/meta-networking/recipes-support/ndisc6/ndisc6/0001-autogen-Do-not-symlink-gettext.h-from-build-host.patch b/meta-networking/recipes-support/ndisc6/ndisc6/0001-autogen-Do-not-symlink-gettext.h-from-build-host.patch
new file mode 100644
index 000000000..eeae5326d
--- /dev/null
+++ b/meta-networking/recipes-support/ndisc6/ndisc6/0001-autogen-Do-not-symlink-gettext.h-from-build-host.patch
@@ -0,0 +1,34 @@
1From 1ee2c998933c4a3d7e7b386352cbdb12f270774c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 6 Sep 2017 20:50:48 -0700
4Subject: [PATCH] autogen: Do not symlink gettext.h from build host
5
6This will create a dependency on build host having gettext
7installed which may not always be the case.
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Inappropriate [Cross-compile specific]
12 autogen.sh | 6 ------
13 1 file changed, 6 deletions(-)
14
15diff --git a/autogen.sh b/autogen.sh
16index 3371011..bbc7add 100755
17--- a/autogen.sh
18+++ b/autogen.sh
19@@ -25,12 +25,6 @@ echo "Running autoreconf ..."
20 autoreconf -sfi
21 unlink po/Makevars.template
22
23-for d in /usr /usr/local /opt/gettext /usr/pkg $HOME ; do
24- if test -f $d/share/gettext/gettext.h ; then
25- ln -sf $d/share/gettext/gettext.h include/gettext.h
26- fi
27-done
28-
29 test -f "include/gettext.h" || {
30 echo "Error: can't find <gettext.h> convenience C header."
31 echo "Please put a link to it by hand as include/gettext.h"
32--
332.14.1
34
diff --git a/meta-networking/recipes-support/ndisc6/ndisc6/0001-replace-VLAIS-with-malloc-free-pair.patch b/meta-networking/recipes-support/ndisc6/ndisc6/0001-replace-VLAIS-with-malloc-free-pair.patch
new file mode 100644
index 000000000..dc58b5b79
--- /dev/null
+++ b/meta-networking/recipes-support/ndisc6/ndisc6/0001-replace-VLAIS-with-malloc-free-pair.patch
@@ -0,0 +1,124 @@
1From 3a7d5396e633e6c02a4583be7faf3d79d0d33748 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Aug 2017 11:14:41 -0700
4Subject: [PATCH 1/2] replace VLAIS with malloc/free pair
5
6Makes it compatible with non-gnu compilers
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10Upstream-Status: Pending
11
12 src/trace-icmp.c | 7 +++++--
13 src/trace-tcp.c | 14 ++++++++++----
14 src/trace-udp.c | 7 +++++--
15 3 files changed, 20 insertions(+), 8 deletions(-)
16
17diff --git a/src/trace-icmp.c b/src/trace-icmp.c
18index 842938e..c76cb54 100644
19--- a/src/trace-icmp.c
20+++ b/src/trace-icmp.c
21@@ -43,16 +43,19 @@ send_echo_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
22 struct
23 {
24 struct icmp6_hdr ih;
25- uint8_t payload[plen - sizeof (struct icmp6_hdr)];
26+ uint8_t *payload;
27 } packet;
28 memset (&packet, 0, plen);
29+ packet.payload = malloc(plen - sizeof (struct icmp6_hdr));
30
31 packet.ih.icmp6_type = ICMP6_ECHO_REQUEST;
32 packet.ih.icmp6_id = htons (getpid ());
33 packet.ih.icmp6_seq = htons ((ttl << 8) | (n & 0xff));
34 (void)port;
35
36- return send_payload (fd, &packet.ih, plen, ttl);
37+ ssize_t ret = send_payload (fd, &packet.ih, plen, ttl);
38+ free(packet.payload);
39+ return ret;
40 }
41
42
43diff --git a/src/trace-tcp.c b/src/trace-tcp.c
44index 940f918..62d22ff 100644
45--- a/src/trace-tcp.c
46+++ b/src/trace-tcp.c
47@@ -54,10 +54,11 @@ send_syn_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
48 struct
49 {
50 struct tcphdr th;
51- uint8_t payload[plen - sizeof (struct tcphdr)];
52+ uint8_t *payload;
53 } packet;
54
55 memset (&packet, 0, sizeof (packet));
56+ packet.payload = malloc(plen - sizeof (struct tcphdr));
57 packet.th.th_sport = sport;
58 packet.th.th_dport = port;
59 packet.th.th_seq = htonl ((ttl << 24) | (n << 16) | (uint16_t)getpid ());
60@@ -65,7 +66,9 @@ send_syn_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
61 packet.th.th_flags = TH_SYN | (ecn ? (TH_ECE | TH_CWR) : 0);
62 packet.th.th_win = htons (TCP_WINDOW);
63
64- return send_payload (fd, &packet, plen, ttl);
65+ ssize_t ret = send_payload (fd, &packet, plen, ttl);
66+ free(packet.payload);
67+ return ret;
68 }
69
70
71@@ -131,10 +134,11 @@ send_ack_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
72 struct
73 {
74 struct tcphdr th;
75- uint8_t payload[plen - sizeof (struct tcphdr)];
76+ uint8_t *payload;
77 } packet;
78
79 memset (&packet, 0, sizeof (packet));
80+ packet.payload = malloc(plen - sizeof (struct tcphdr));
81 packet.th.th_sport = sport;
82 packet.th.th_dport = port;
83 packet.th.th_ack = htonl ((ttl << 24) | (n << 16) | (uint16_t)getpid ());
84@@ -142,7 +146,9 @@ send_ack_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
85 packet.th.th_flags = TH_ACK;
86 packet.th.th_win = htons (TCP_WINDOW);
87
88- return send_payload (fd, &packet, plen, ttl);
89+ ssize_t ret = send_payload (fd, &packet, plen, ttl);
90+ free(packet.payload);
91+ return ret;
92 }
93
94
95diff --git a/src/trace-udp.c b/src/trace-udp.c
96index 4adde6b..a6cbb07 100644
97--- a/src/trace-udp.c
98+++ b/src/trace-udp.c
99@@ -46,9 +46,10 @@ send_udp_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
100 struct
101 {
102 struct udphdr uh;
103- uint8_t payload[plen - sizeof (struct udphdr)];
104+ uint8_t *payload;
105 } packet;
106 memset (&packet, 0, plen);
107+ packet.payload = malloc(plen - sizeof (struct udphdr));
108
109 (void)n;
110 packet.uh.uh_sport = sport;
111@@ -61,7 +62,9 @@ send_udp_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
112 /*if (plen > sizeof (struct udphdr))
113 packet.payload[0] = (uint8_t)ttl;*/
114
115- return send_payload (fd, &packet, plen, ttl);
116+ ssize_t ret = send_payload (fd, &packet, plen, ttl);
117+ free(packet.payload);
118+ return ret;
119 }
120
121
122--
1232.14.1
124
diff --git a/meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch b/meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch
new file mode 100644
index 000000000..3cc2ba80c
--- /dev/null
+++ b/meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch
@@ -0,0 +1,30 @@
1From 2a50154fbce38fd36be7e14f5cd4a8b03c65c72f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Aug 2017 11:15:37 -0700
4Subject: [PATCH 2/2] Do not undef _GNU_SOURCE
5
6There are functions from tcp.h which are under _GNU_SOURCE
7in musl
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Pending
12
13 src/trace-tcp.c | 1 -
14 1 file changed, 1 deletion(-)
15
16diff --git a/src/trace-tcp.c b/src/trace-tcp.c
17index 62d22ff..380008e 100644
18--- a/src/trace-tcp.c
19+++ b/src/trace-tcp.c
20@@ -21,7 +21,6 @@
21 # include <config.h>
22 #endif
23
24-#undef _GNU_SOURCE
25 #define _DEFAULT_SOURCE 1
26
27 #include <string.h>
28--
292.14.1
30
diff --git a/meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb b/meta-networking/recipes-support/ndisc6/ndisc6_git.bb
index 0b5c9e467..002303c96 100644
--- a/meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb
+++ b/meta-networking/recipes-support/ndisc6/ndisc6_git.bb
@@ -3,22 +3,37 @@ IPv6 networks, including ndisc6, rdisc6, tcptraceroute6 and traceroute6."
3SECTION = "net" 3SECTION = "net"
4HOMEPAGE = "http://www.remlab.net/ndisc6/" 4HOMEPAGE = "http://www.remlab.net/ndisc6/"
5LICENSE = "GPL-2.0" 5LICENSE = "GPL-2.0"
6LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
6 7
7# The tcptraceroute6 and tracert6 commands depend on rltraceroute6 to 8PV = "1.0.4+git${SRCPV}"
8# perform the actual trace operation. 9SRCREV = "4c794b5512d23c649def1f94a684225dcbb6ac3e"
9RDEPENDS_${PN}-tcptraceroute6 = "${PN}-rltraceroute6" 10SRC_URI = "git://git.remlab.net/git/ndisc6.git;protocol=http \
10RDEPENDS_${PN}-tracert6 = "${PN}-rltraceroute6" 11 file://0001-replace-VLAIS-with-malloc-free-pair.patch \
11RDEPENDS_${PN}-misc += "perl" 12 file://0002-Do-not-undef-_GNU_SOURCE.patch \
13 file://0001-autogen-Do-not-symlink-gettext.h-from-build-host.patch \
14 "
12 15
13SRC_URI = "http://www.remlab.net/files/ndisc6/ndisc6-${PV}.tar.bz2 \ 16S = "${WORKDIR}/git"
14"
15SRC_URI[md5sum] = "21afdaa3a5a5c1ce50eb7f2b7d795989"
16SRC_URI[sha256sum] = "0f41d6caf5f2edc1a12924956ae8b1d372e3b426bd7b11eed7d38bc974eec821"
17
18LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
19 17
20inherit autotools gettext 18inherit autotools gettext
21 19
20EXTRA_OECONF += "PERL=${USRBINPATH}/perl"
21
22LDFLAGS += "-fuse-ld=gold"
23TOOLCHAIN = "gcc"
24
25do_configure_prepend() {
26 cp ${STAGING_DATADIR_NATIVE}/gettext/gettext.h ${S}/include
27 ${S}/autogen.sh
28}
29
30do_install_append () {
31 rm -rf ${D}${localstatedir}
32 # Enable SUID bit for applications that need it
33 chmod 4555 ${D}${bindir}/rltraceroute6
34 chmod 4555 ${D}${bindir}/ndisc6
35 chmod 4555 ${D}${bindir}/rdisc6
36}
22ALLOW_EMPTY_${PN} = "1" 37ALLOW_EMPTY_${PN} = "1"
23 38
24# Split into seperate packages since we normal don't want them all 39# Split into seperate packages since we normal don't want them all
@@ -49,6 +64,12 @@ or IPv4."
49DESCRITPION_${PN}-rdnssd = "Daemon to autoconfigure the list of DNS \ 64DESCRITPION_${PN}-rdnssd = "Daemon to autoconfigure the list of DNS \
50servers through slateless IPv6 autoconfiguration." 65servers through slateless IPv6 autoconfiguration."
51 66
67# The tcptraceroute6 and tracert6 commands depend on rltraceroute6 to
68# perform the actual trace operation.
69RDEPENDS_${PN}-tcptraceroute6 = "${PN}-rltraceroute6"
70RDEPENDS_${PN}-tracert6 = "${PN}-rltraceroute6"
71RDEPENDS_${PN}-misc += "perl"
72
52do_install_append () { 73do_install_append () {
53 rm -rf ${D}${localstatedir} 74 rm -rf ${D}${localstatedir}
54 # Enable SUID bit for applications that need it 75 # Enable SUID bit for applications that need it