diff mbox series

[oe,meta-networking,1/4] ndisc6: Fix build with clang and update to latest on git

Message ID 20170831232645.6125-1-raj.khem@gmail.com
State Superseded
Headers show
Series [oe,meta-networking,1/4] ndisc6: Fix build with clang and update to latest on git | expand

Commit Message

Khem Raj Aug. 31, 2017, 11:26 p.m. UTC
Change recipe to git
Pass PERL variable to configure
Add patches to fix VLAIS

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 .../0001-replace-VLAIS-with-malloc-free-pair.patch | 124 +++++++++++++++++++++
 .../ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch     |  30 +++++
 .../ndisc6/{ndisc6_1.0.3.bb => ndisc6_git.bb}      |  21 ++--
 3 files changed, 168 insertions(+), 7 deletions(-)
 create mode 100644 meta-networking/recipes-support/ndisc6/ndisc6/0001-replace-VLAIS-with-malloc-free-pair.patch
 create mode 100644 meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch
 rename meta-networking/recipes-support/ndisc6/{ndisc6_1.0.3.bb => ndisc6_git.bb} (87%)

-- 
2.14.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Comments

Martin Jansa Sept. 4, 2017, 1:32 p.m. UTC | #1
The git server seems to be down here.
http://errors.yoctoproject.org/Errors/Details/155044/

and you can also drop the SRC_URI checksums now when it is using git
fetcher.

On Fri, Sep 1, 2017 at 1:26 AM, Khem Raj <raj.khem@gmail.com> wrote:

> Change recipe to git

> Pass PERL variable to configure

> Add patches to fix VLAIS

>

> Signed-off-by: Khem Raj <raj.khem@gmail.com>

> ---

>  .../0001-replace-VLAIS-with-malloc-free-pair.patch | 124

> +++++++++++++++++++++

>  .../ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch     |  30 +++++

>  .../ndisc6/{ndisc6_1.0.3.bb => ndisc6_git.bb}      |  21 ++--

>  3 files changed, 168 insertions(+), 7 deletions(-)

>  create mode 100644 meta-networking/recipes-support/ndisc6/ndisc6/0001-

> replace-VLAIS-with-malloc-free-pair.patch

>  create mode 100644 meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-

> not-undef-_GNU_SOURCE.patch

>  rename meta-networking/recipes-support/ndisc6/{ndisc6_1.0.3.bb =>

> ndisc6_git.bb} (87%)

>

> 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 @@

> +From 3a7d5396e633e6c02a4583be7faf3d79d0d33748 Mon Sep 17 00:00:00 2001

> +From: Khem Raj <raj.khem@gmail.com>

> +Date: Thu, 31 Aug 2017 11:14:41 -0700

> +Subject: [PATCH 1/2] replace VLAIS with malloc/free pair

> +

> +Makes it compatible with non-gnu compilers

> +

> +Signed-off-by: Khem Raj <raj.khem@gmail.com>

> +---

> +Upstream-Status: Pending

> +

> + src/trace-icmp.c |  7 +++++--

> + src/trace-tcp.c  | 14 ++++++++++----

> + src/trace-udp.c  |  7 +++++--

> + 3 files changed, 20 insertions(+), 8 deletions(-)

> +

> +diff --git a/src/trace-icmp.c b/src/trace-icmp.c

> +index 842938e..c76cb54 100644

> +--- a/src/trace-icmp.c

> ++++ b/src/trace-icmp.c

> +@@ -43,16 +43,19 @@ send_echo_probe (int fd, unsigned ttl, unsigned n,

> size_t plen, uint16_t port)

> +       struct

> +       {

> +               struct icmp6_hdr ih;

> +-              uint8_t payload[plen - sizeof (struct icmp6_hdr)];

> ++              uint8_t *payload;

> +       } packet;

> +       memset (&packet, 0, plen);

> ++      packet.payload = malloc(plen - sizeof (struct icmp6_hdr));

> +

> +       packet.ih.icmp6_type = ICMP6_ECHO_REQUEST;

> +       packet.ih.icmp6_id = htons (getpid ());

> +       packet.ih.icmp6_seq = htons ((ttl << 8) | (n & 0xff));

> +       (void)port;

> +

> +-      return send_payload (fd, &packet.ih, plen, ttl);

> ++      ssize_t ret = send_payload (fd, &packet.ih, plen, ttl);

> ++      free(packet.payload);

> ++      return ret;

> + }

> +

> +

> +diff --git a/src/trace-tcp.c b/src/trace-tcp.c

> +index 940f918..62d22ff 100644

> +--- a/src/trace-tcp.c

> ++++ b/src/trace-tcp.c

> +@@ -54,10 +54,11 @@ send_syn_probe (int fd, unsigned ttl, unsigned n,

> size_t plen, uint16_t port)

> +       struct

> +       {

> +               struct tcphdr th;

> +-              uint8_t payload[plen - sizeof (struct tcphdr)];

> ++              uint8_t *payload;

> +       } packet;

> +

> +       memset (&packet, 0, sizeof (packet));

> ++      packet.payload = malloc(plen - sizeof (struct tcphdr));

> +       packet.th.th_sport = sport;

> +       packet.th.th_dport = port;

> +       packet.th.th_seq = htonl ((ttl << 24) | (n << 16) |

> (uint16_t)getpid ());

> +@@ -65,7 +66,9 @@ send_syn_probe (int fd, unsigned ttl, unsigned n,

> size_t plen, uint16_t port)

> +       packet.th.th_flags = TH_SYN | (ecn ? (TH_ECE | TH_CWR) : 0);

> +       packet.th.th_win = htons (TCP_WINDOW);

> +

> +-      return send_payload (fd, &packet, plen, ttl);

> ++      ssize_t ret = send_payload (fd, &packet, plen, ttl);

> ++      free(packet.payload);

> ++      return ret;

> + }

> +

> +

> +@@ -131,10 +134,11 @@ send_ack_probe (int fd, unsigned ttl, unsigned n,

> size_t plen, uint16_t port)

> +       struct

> +       {

> +               struct tcphdr th;

> +-              uint8_t payload[plen - sizeof (struct tcphdr)];

> ++              uint8_t *payload;

> +       } packet;

> +

> +       memset (&packet, 0, sizeof (packet));

> ++      packet.payload = malloc(plen - sizeof (struct tcphdr));

> +       packet.th.th_sport = sport;

> +       packet.th.th_dport = port;

> +       packet.th.th_ack = htonl ((ttl << 24) | (n << 16) |

> (uint16_t)getpid ());

> +@@ -142,7 +146,9 @@ send_ack_probe (int fd, unsigned ttl, unsigned n,

> size_t plen, uint16_t port)

> +       packet.th.th_flags = TH_ACK;

> +       packet.th.th_win = htons (TCP_WINDOW);

> +

> +-      return send_payload (fd, &packet, plen, ttl);

> ++      ssize_t ret = send_payload (fd, &packet, plen, ttl);

> ++      free(packet.payload);

> ++      return ret;

> + }

> +

> +

> +diff --git a/src/trace-udp.c b/src/trace-udp.c

> +index 4adde6b..a6cbb07 100644

> +--- a/src/trace-udp.c

> ++++ b/src/trace-udp.c

> +@@ -46,9 +46,10 @@ send_udp_probe (int fd, unsigned ttl, unsigned n,

> size_t plen, uint16_t port)

> +       struct

> +       {

> +               struct udphdr uh;

> +-              uint8_t payload[plen - sizeof (struct udphdr)];

> ++              uint8_t *payload;

> +       } packet;

> +       memset (&packet, 0, plen);

> ++      packet.payload = malloc(plen - sizeof (struct udphdr));

> +

> +       (void)n;

> +       packet.uh.uh_sport = sport;

> +@@ -61,7 +62,9 @@ send_udp_probe (int fd, unsigned ttl, unsigned n,

> size_t plen, uint16_t port)

> +       /*if (plen > sizeof (struct udphdr))

> +               packet.payload[0] = (uint8_t)ttl;*/

> +

> +-      return send_payload (fd, &packet, plen, ttl);

> ++      ssize_t ret = send_payload (fd, &packet, plen, ttl);

> ++      free(packet.payload);

> ++      return ret;

> + }

> +

> +

> +--

> +2.14.1

> +

> 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 @@

> +From 2a50154fbce38fd36be7e14f5cd4a8b03c65c72f Mon Sep 17 00:00:00 2001

> +From: Khem Raj <raj.khem@gmail.com>

> +Date: Thu, 31 Aug 2017 11:15:37 -0700

> +Subject: [PATCH 2/2] Do not undef _GNU_SOURCE

> +

> +There are functions from tcp.h which are under _GNU_SOURCE

> +in musl

> +

> +Signed-off-by: Khem Raj <raj.khem@gmail.com>

> +---

> +Upstream-Status: Pending

> +

> + src/trace-tcp.c | 1 -

> + 1 file changed, 1 deletion(-)

> +

> +diff --git a/src/trace-tcp.c b/src/trace-tcp.c

> +index 62d22ff..380008e 100644

> +--- a/src/trace-tcp.c

> ++++ b/src/trace-tcp.c

> +@@ -21,7 +21,6 @@

> + # include <config.h>

> + #endif

> +

> +-#undef _GNU_SOURCE

> + #define _DEFAULT_SOURCE 1

> +

> + #include <string.h>

> +--

> +2.14.1

> +

> diff --git a/meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb

> b/meta-networking/recipes-support/ndisc6/ndisc6_git.bb

> similarity index 87%

> rename from meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb

> rename to meta-networking/recipes-support/ndisc6/ndisc6_git.bb

> index 6bc0531b9..1ff2df731 100644

> --- a/meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb

> +++ b/meta-networking/recipes-support/ndisc6/ndisc6_git.bb

> @@ -10,15 +10,27 @@ RDEPENDS_${PN}-tcptraceroute6 = "${PN}-rltraceroute6"

>  RDEPENDS_${PN}-tracert6 = "${PN}-rltraceroute6"

>  RDEPENDS_${PN}-misc += "perl"

>

> -SRC_URI = "http://www.remlab.net/files/ndisc6/ndisc6-${PV}.tar.bz2 \

> -"

> +PV = "1.0.4+git${SRCPV}"

> +SRCREV = "4c794b5512d23c649def1f94a684225dcbb6ac3e"

> +SRC_URI = "git://git.remlab.net/git/ndisc6.git \

> +           file://0001-replace-VLAIS-with-malloc-free-pair.patch \

> +           file://0002-Do-not-undef-_GNU_SOURCE.patch \

> +           "

>  SRC_URI[md5sum] = "21afdaa3a5a5c1ce50eb7f2b7d795989"

>  SRC_URI[sha256sum] = "0f41d6caf5f2edc1a12924956ae8b1

> d372e3b426bd7b11eed7d38bc974eec821"

>

>  LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"

>

> +S = "${WORKDIR}/git"

> +

>  inherit autotools gettext

>

> +EXTRA_OECONF += "PERL=${USRBINPATH}/perl"

> +

> +do_configure_prepend() {

> +    ${S}/autogen.sh

> +}

> +

>  ALLOW_EMPTY_${PN} = "1"

>

>  # Split into seperate packages since we normal don't want them all

> @@ -49,11 +61,6 @@ or IPv4."

>  DESCRITPION_${PN}-rdnssd       = "Daemon to autoconfigure the list of DNS

> \

>  servers through slateless IPv6 autoconfiguration."

>

> -# We do not run perl during the build, but only use it on the target.

> -do_configure_prepend() {

> -    export PERL="/usr/bin/perl"

> -}

> -

>  do_install_append () {

>      rm -rf ${D}${localstatedir}

>      # Enable SUID bit for applications that need it

> --

> 2.14.1

>

> --

> _______________________________________________

> Openembedded-devel mailing list

> Openembedded-devel@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

>

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Khem Raj Sept. 4, 2017, 5:35 p.m. UTC | #2
On Mon, Sep 4, 2017 at 6:32 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> The git server seems to be down here.

> http://errors.yoctoproject.org/Errors/Details/155044/


yeah switching to http protocol helped.

>

> and you can also drop the SRC_URI checksums now when it is using git

> fetcher.


done in v2.

>

> On Fri, Sep 1, 2017 at 1:26 AM, Khem Raj <raj.khem@gmail.com> wrote:

>>

>> Change recipe to git

>> Pass PERL variable to configure

>> Add patches to fix VLAIS

>>

>> Signed-off-by: Khem Raj <raj.khem@gmail.com>

>> ---

>>  .../0001-replace-VLAIS-with-malloc-free-pair.patch | 124

>> +++++++++++++++++++++

>>  .../ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch     |  30 +++++

>>  .../ndisc6/{ndisc6_1.0.3.bb => ndisc6_git.bb}      |  21 ++--

>>  3 files changed, 168 insertions(+), 7 deletions(-)

>>  create mode 100644

>> meta-networking/recipes-support/ndisc6/ndisc6/0001-replace-VLAIS-with-malloc-free-pair.patch

>>  create mode 100644

>> meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch

>>  rename meta-networking/recipes-support/ndisc6/{ndisc6_1.0.3.bb =>

>> ndisc6_git.bb} (87%)

>>

>> 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 @@

>> +From 3a7d5396e633e6c02a4583be7faf3d79d0d33748 Mon Sep 17 00:00:00 2001

>> +From: Khem Raj <raj.khem@gmail.com>

>> +Date: Thu, 31 Aug 2017 11:14:41 -0700

>> +Subject: [PATCH 1/2] replace VLAIS with malloc/free pair

>> +

>> +Makes it compatible with non-gnu compilers

>> +

>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>

>> +---

>> +Upstream-Status: Pending

>> +

>> + src/trace-icmp.c |  7 +++++--

>> + src/trace-tcp.c  | 14 ++++++++++----

>> + src/trace-udp.c  |  7 +++++--

>> + 3 files changed, 20 insertions(+), 8 deletions(-)

>> +

>> +diff --git a/src/trace-icmp.c b/src/trace-icmp.c

>> +index 842938e..c76cb54 100644

>> +--- a/src/trace-icmp.c

>> ++++ b/src/trace-icmp.c

>> +@@ -43,16 +43,19 @@ send_echo_probe (int fd, unsigned ttl, unsigned n,

>> size_t plen, uint16_t port)

>> +       struct

>> +       {

>> +               struct icmp6_hdr ih;

>> +-              uint8_t payload[plen - sizeof (struct icmp6_hdr)];

>> ++              uint8_t *payload;

>> +       } packet;

>> +       memset (&packet, 0, plen);

>> ++      packet.payload = malloc(plen - sizeof (struct icmp6_hdr));

>> +

>> +       packet.ih.icmp6_type = ICMP6_ECHO_REQUEST;

>> +       packet.ih.icmp6_id = htons (getpid ());

>> +       packet.ih.icmp6_seq = htons ((ttl << 8) | (n & 0xff));

>> +       (void)port;

>> +

>> +-      return send_payload (fd, &packet.ih, plen, ttl);

>> ++      ssize_t ret = send_payload (fd, &packet.ih, plen, ttl);

>> ++      free(packet.payload);

>> ++      return ret;

>> + }

>> +

>> +

>> +diff --git a/src/trace-tcp.c b/src/trace-tcp.c

>> +index 940f918..62d22ff 100644

>> +--- a/src/trace-tcp.c

>> ++++ b/src/trace-tcp.c

>> +@@ -54,10 +54,11 @@ send_syn_probe (int fd, unsigned ttl, unsigned n,

>> size_t plen, uint16_t port)

>> +       struct

>> +       {

>> +               struct tcphdr th;

>> +-              uint8_t payload[plen - sizeof (struct tcphdr)];

>> ++              uint8_t *payload;

>> +       } packet;

>> +

>> +       memset (&packet, 0, sizeof (packet));

>> ++      packet.payload = malloc(plen - sizeof (struct tcphdr));

>> +       packet.th.th_sport = sport;

>> +       packet.th.th_dport = port;

>> +       packet.th.th_seq = htonl ((ttl << 24) | (n << 16) |

>> (uint16_t)getpid ());

>> +@@ -65,7 +66,9 @@ send_syn_probe (int fd, unsigned ttl, unsigned n,

>> size_t plen, uint16_t port)

>> +       packet.th.th_flags = TH_SYN | (ecn ? (TH_ECE | TH_CWR) : 0);

>> +       packet.th.th_win = htons (TCP_WINDOW);

>> +

>> +-      return send_payload (fd, &packet, plen, ttl);

>> ++      ssize_t ret = send_payload (fd, &packet, plen, ttl);

>> ++      free(packet.payload);

>> ++      return ret;

>> + }

>> +

>> +

>> +@@ -131,10 +134,11 @@ send_ack_probe (int fd, unsigned ttl, unsigned n,

>> size_t plen, uint16_t port)

>> +       struct

>> +       {

>> +               struct tcphdr th;

>> +-              uint8_t payload[plen - sizeof (struct tcphdr)];

>> ++              uint8_t *payload;

>> +       } packet;

>> +

>> +       memset (&packet, 0, sizeof (packet));

>> ++      packet.payload = malloc(plen - sizeof (struct tcphdr));

>> +       packet.th.th_sport = sport;

>> +       packet.th.th_dport = port;

>> +       packet.th.th_ack = htonl ((ttl << 24) | (n << 16) |

>> (uint16_t)getpid ());

>> +@@ -142,7 +146,9 @@ send_ack_probe (int fd, unsigned ttl, unsigned n,

>> size_t plen, uint16_t port)

>> +       packet.th.th_flags = TH_ACK;

>> +       packet.th.th_win = htons (TCP_WINDOW);

>> +

>> +-      return send_payload (fd, &packet, plen, ttl);

>> ++      ssize_t ret = send_payload (fd, &packet, plen, ttl);

>> ++      free(packet.payload);

>> ++      return ret;

>> + }

>> +

>> +

>> +diff --git a/src/trace-udp.c b/src/trace-udp.c

>> +index 4adde6b..a6cbb07 100644

>> +--- a/src/trace-udp.c

>> ++++ b/src/trace-udp.c

>> +@@ -46,9 +46,10 @@ send_udp_probe (int fd, unsigned ttl, unsigned n,

>> size_t plen, uint16_t port)

>> +       struct

>> +       {

>> +               struct udphdr uh;

>> +-              uint8_t payload[plen - sizeof (struct udphdr)];

>> ++              uint8_t *payload;

>> +       } packet;

>> +       memset (&packet, 0, plen);

>> ++      packet.payload = malloc(plen - sizeof (struct udphdr));

>> +

>> +       (void)n;

>> +       packet.uh.uh_sport = sport;

>> +@@ -61,7 +62,9 @@ send_udp_probe (int fd, unsigned ttl, unsigned n,

>> size_t plen, uint16_t port)

>> +       /*if (plen > sizeof (struct udphdr))

>> +               packet.payload[0] = (uint8_t)ttl;*/

>> +

>> +-      return send_payload (fd, &packet, plen, ttl);

>> ++      ssize_t ret = send_payload (fd, &packet, plen, ttl);

>> ++      free(packet.payload);

>> ++      return ret;

>> + }

>> +

>> +

>> +--

>> +2.14.1

>> +

>> 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 @@

>> +From 2a50154fbce38fd36be7e14f5cd4a8b03c65c72f Mon Sep 17 00:00:00 2001

>> +From: Khem Raj <raj.khem@gmail.com>

>> +Date: Thu, 31 Aug 2017 11:15:37 -0700

>> +Subject: [PATCH 2/2] Do not undef _GNU_SOURCE

>> +

>> +There are functions from tcp.h which are under _GNU_SOURCE

>> +in musl

>> +

>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>

>> +---

>> +Upstream-Status: Pending

>> +

>> + src/trace-tcp.c | 1 -

>> + 1 file changed, 1 deletion(-)

>> +

>> +diff --git a/src/trace-tcp.c b/src/trace-tcp.c

>> +index 62d22ff..380008e 100644

>> +--- a/src/trace-tcp.c

>> ++++ b/src/trace-tcp.c

>> +@@ -21,7 +21,6 @@

>> + # include <config.h>

>> + #endif

>> +

>> +-#undef _GNU_SOURCE

>> + #define _DEFAULT_SOURCE 1

>> +

>> + #include <string.h>

>> +--

>> +2.14.1

>> +

>> diff --git a/meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb

>> b/meta-networking/recipes-support/ndisc6/ndisc6_git.bb

>> similarity index 87%

>> rename from meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb

>> rename to meta-networking/recipes-support/ndisc6/ndisc6_git.bb

>> index 6bc0531b9..1ff2df731 100644

>> --- a/meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb

>> +++ b/meta-networking/recipes-support/ndisc6/ndisc6_git.bb

>> @@ -10,15 +10,27 @@ RDEPENDS_${PN}-tcptraceroute6 = "${PN}-rltraceroute6"

>>  RDEPENDS_${PN}-tracert6 = "${PN}-rltraceroute6"

>>  RDEPENDS_${PN}-misc += "perl"

>>

>> -SRC_URI = "http://www.remlab.net/files/ndisc6/ndisc6-${PV}.tar.bz2 \

>> -"

>> +PV = "1.0.4+git${SRCPV}"

>> +SRCREV = "4c794b5512d23c649def1f94a684225dcbb6ac3e"

>> +SRC_URI = "git://git.remlab.net/git/ndisc6.git \

>> +           file://0001-replace-VLAIS-with-malloc-free-pair.patch \

>> +           file://0002-Do-not-undef-_GNU_SOURCE.patch \

>> +           "

>>  SRC_URI[md5sum] = "21afdaa3a5a5c1ce50eb7f2b7d795989"

>>  SRC_URI[sha256sum] =

>> "0f41d6caf5f2edc1a12924956ae8b1d372e3b426bd7b11eed7d38bc974eec821"

>>

>>  LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"

>>

>> +S = "${WORKDIR}/git"

>> +

>>  inherit autotools gettext

>>

>> +EXTRA_OECONF += "PERL=${USRBINPATH}/perl"

>> +

>> +do_configure_prepend() {

>> +    ${S}/autogen.sh

>> +}

>> +

>>  ALLOW_EMPTY_${PN} = "1"

>>

>>  # Split into seperate packages since we normal don't want them all

>> @@ -49,11 +61,6 @@ or IPv4."

>>  DESCRITPION_${PN}-rdnssd       = "Daemon to autoconfigure the list of DNS

>> \

>>  servers through slateless IPv6 autoconfiguration."

>>

>> -# We do not run perl during the build, but only use it on the target.

>> -do_configure_prepend() {

>> -    export PERL="/usr/bin/perl"

>> -}

>> -

>>  do_install_append () {

>>      rm -rf ${D}${localstatedir}

>>      # Enable SUID bit for applications that need it

>> --

>> 2.14.1

>>

>> --

>> _______________________________________________

>> Openembedded-devel mailing list

>> Openembedded-devel@lists.openembedded.org

>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

>

>

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

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 @@ 
+From 3a7d5396e633e6c02a4583be7faf3d79d0d33748 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Aug 2017 11:14:41 -0700
+Subject: [PATCH 1/2] replace VLAIS with malloc/free pair
+
+Makes it compatible with non-gnu compilers
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/trace-icmp.c |  7 +++++--
+ src/trace-tcp.c  | 14 ++++++++++----
+ src/trace-udp.c  |  7 +++++--
+ 3 files changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/src/trace-icmp.c b/src/trace-icmp.c
+index 842938e..c76cb54 100644
+--- a/src/trace-icmp.c
++++ b/src/trace-icmp.c
+@@ -43,16 +43,19 @@ send_echo_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ 	struct
+ 	{
+ 		struct icmp6_hdr ih;
+-		uint8_t payload[plen - sizeof (struct icmp6_hdr)];
++		uint8_t *payload;
+ 	} packet;
+ 	memset (&packet, 0, plen);
++	packet.payload = malloc(plen - sizeof (struct icmp6_hdr));
+ 
+ 	packet.ih.icmp6_type = ICMP6_ECHO_REQUEST;
+ 	packet.ih.icmp6_id = htons (getpid ());
+ 	packet.ih.icmp6_seq = htons ((ttl << 8) | (n & 0xff));
+ 	(void)port;
+ 
+-	return send_payload (fd, &packet.ih, plen, ttl);
++	ssize_t ret = send_payload (fd, &packet.ih, plen, ttl);
++	free(packet.payload);
++	return ret;
+ }
+ 
+ 
+diff --git a/src/trace-tcp.c b/src/trace-tcp.c
+index 940f918..62d22ff 100644
+--- a/src/trace-tcp.c
++++ b/src/trace-tcp.c
+@@ -54,10 +54,11 @@ send_syn_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ 	struct
+ 	{
+ 		struct tcphdr th;
+-		uint8_t payload[plen - sizeof (struct tcphdr)];
++		uint8_t *payload;
+ 	} packet;
+ 
+ 	memset (&packet, 0, sizeof (packet));
++	packet.payload = malloc(plen - sizeof (struct tcphdr));
+ 	packet.th.th_sport = sport;
+ 	packet.th.th_dport = port;
+ 	packet.th.th_seq = htonl ((ttl << 24) | (n << 16) | (uint16_t)getpid ());
+@@ -65,7 +66,9 @@ send_syn_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ 	packet.th.th_flags = TH_SYN | (ecn ? (TH_ECE | TH_CWR) : 0);
+ 	packet.th.th_win = htons (TCP_WINDOW);
+ 
+-	return send_payload (fd, &packet, plen, ttl);
++	ssize_t ret = send_payload (fd, &packet, plen, ttl);
++	free(packet.payload);
++	return ret;
+ }
+ 
+ 
+@@ -131,10 +134,11 @@ send_ack_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ 	struct
+ 	{
+ 		struct tcphdr th;
+-		uint8_t payload[plen - sizeof (struct tcphdr)];
++		uint8_t *payload;
+ 	} packet;
+ 
+ 	memset (&packet, 0, sizeof (packet));
++	packet.payload = malloc(plen - sizeof (struct tcphdr));
+ 	packet.th.th_sport = sport;
+ 	packet.th.th_dport = port;
+ 	packet.th.th_ack = htonl ((ttl << 24) | (n << 16) | (uint16_t)getpid ());
+@@ -142,7 +146,9 @@ send_ack_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ 	packet.th.th_flags = TH_ACK;
+ 	packet.th.th_win = htons (TCP_WINDOW);
+ 
+-	return send_payload (fd, &packet, plen, ttl);
++	ssize_t ret = send_payload (fd, &packet, plen, ttl);
++	free(packet.payload);
++	return ret;
+ }
+ 
+ 
+diff --git a/src/trace-udp.c b/src/trace-udp.c
+index 4adde6b..a6cbb07 100644
+--- a/src/trace-udp.c
++++ b/src/trace-udp.c
+@@ -46,9 +46,10 @@ send_udp_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ 	struct
+ 	{
+ 		struct udphdr uh;
+-		uint8_t payload[plen - sizeof (struct udphdr)];
++		uint8_t *payload;
+ 	} packet;
+ 	memset (&packet, 0, plen);
++	packet.payload = malloc(plen - sizeof (struct udphdr));
+ 
+ 	(void)n;
+ 	packet.uh.uh_sport = sport;
+@@ -61,7 +62,9 @@ send_udp_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ 	/*if (plen > sizeof (struct udphdr))
+ 		packet.payload[0] = (uint8_t)ttl;*/
+ 
+-	return send_payload (fd, &packet, plen, ttl);
++	ssize_t ret = send_payload (fd, &packet, plen, ttl);
++	free(packet.payload);
++	return ret;
+ }
+ 
+ 
+-- 
+2.14.1
+
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 @@ 
+From 2a50154fbce38fd36be7e14f5cd4a8b03c65c72f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Aug 2017 11:15:37 -0700
+Subject: [PATCH 2/2] Do not undef _GNU_SOURCE
+
+There are functions from tcp.h which are under _GNU_SOURCE
+in musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/trace-tcp.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/trace-tcp.c b/src/trace-tcp.c
+index 62d22ff..380008e 100644
+--- a/src/trace-tcp.c
++++ b/src/trace-tcp.c
+@@ -21,7 +21,6 @@
+ # include <config.h>
+ #endif
+ 
+-#undef _GNU_SOURCE
+ #define _DEFAULT_SOURCE 1
+ 
+ #include <string.h>
+-- 
+2.14.1
+
diff --git a/meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb b/meta-networking/recipes-support/ndisc6/ndisc6_git.bb
similarity index 87%
rename from meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb
rename to meta-networking/recipes-support/ndisc6/ndisc6_git.bb
index 6bc0531b9..1ff2df731 100644
--- a/meta-networking/recipes-support/ndisc6/ndisc6_1.0.3.bb
+++ b/meta-networking/recipes-support/ndisc6/ndisc6_git.bb
@@ -10,15 +10,27 @@  RDEPENDS_${PN}-tcptraceroute6 = "${PN}-rltraceroute6"
 RDEPENDS_${PN}-tracert6 = "${PN}-rltraceroute6"
 RDEPENDS_${PN}-misc += "perl"
 
-SRC_URI = "http://www.remlab.net/files/ndisc6/ndisc6-${PV}.tar.bz2 \
-"
+PV = "1.0.4+git${SRCPV}"
+SRCREV = "4c794b5512d23c649def1f94a684225dcbb6ac3e"
+SRC_URI = "git://git.remlab.net/git/ndisc6.git \
+           file://0001-replace-VLAIS-with-malloc-free-pair.patch \
+           file://0002-Do-not-undef-_GNU_SOURCE.patch \
+           "
 SRC_URI[md5sum] = "21afdaa3a5a5c1ce50eb7f2b7d795989"
 SRC_URI[sha256sum] = "0f41d6caf5f2edc1a12924956ae8b1d372e3b426bd7b11eed7d38bc974eec821"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
+S = "${WORKDIR}/git"
+
 inherit autotools gettext
 
+EXTRA_OECONF += "PERL=${USRBINPATH}/perl"
+
+do_configure_prepend() {
+    ${S}/autogen.sh
+}
+
 ALLOW_EMPTY_${PN} = "1"
 
 # Split into seperate packages since we normal don't want them all
@@ -49,11 +61,6 @@  or IPv4."
 DESCRITPION_${PN}-rdnssd       = "Daemon to autoconfigure the list of DNS \
 servers through slateless IPv6 autoconfiguration."
 
-# We do not run perl during the build, but only use it on the target.
-do_configure_prepend() {
-    export PERL="/usr/bin/perl"
-}
-
 do_install_append () {
     rm -rf ${D}${localstatedir}
     # Enable SUID bit for applications that need it