Skip to contentSkip to conversation

ippool: Fix build errors found with hardening flags

PATCH Superseded Khem Raj 2 participants 6 messages Jul 19, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 ippool: Fix build errors found with hardening flags

---
 ...timer-Check-for-return-value-of-write-API.patch | 28 ++++++++++++++++++++++
 .../recipes-daemons/ippool/ippool_1.3.bb           | 22 ++++++++---------
 2 files changed, 39 insertions(+), 11 deletions(-)
 create mode 100644 meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch
meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch new file +28 -0
new file mode 100644
index 000000000..6fb7cc5c4
@@ -0,0 +1,28 @@
+From 5d7f20c045b3c74dad2c53d65e30bd4840250082 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 27 Jun 2017 15:17:19 -0700
+Subject: [PATCH] usl_timer: Check for return value of write() API
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ usl/usl_timer.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/usl/usl_timer.c b/usl/usl_timer.c
+index fda752b..d8414a6 100644
+--- a/usl/usl_timer.c
++++ b/usl/usl_timer.c
+@@ -94,7 +94,9 @@ void usl_timer_tick(void)
+ 
+ 	if (!usl_tick_pending) {
+ 		usl_tick_pending = 1;
+-		write(usl_tick_pipe[1], &msg, sizeof(msg));
++		if (write(usl_tick_pipe[1], &msg, sizeof(msg)) != sizeof(msg)) {
++			fprintf(stderr, "write to fd %i failed: %s\n", usl_tick_pipe[1], strerror(errno));
++		}
+ 	}
+ }
+ 
+-- 
+2.13.2
+
meta-networking/recipes-daemons/ippool/ippool_1.3.bb +11 -11
index 969f434cc..e1c9215ca 100644
@@ -11,16 +11,16 @@ HOMEPAGE = "http://www.openl2tp.org/"
 SECTION = "console/network"
 LICENSE = "GPLv2+"
 
-SRC_URI = "\
-        https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
-        file://ippool_usl_timer.patch \
-        file://ippool_parallel_make_and_pic.patch \
-        file://ippool_init.d.patch \
-        file://always_syslog.patch \
-        file://makefile-add-ldflags.patch \
-        file://runtest.sh \
-        file://ippool.service \
-        "
+SRC_URI = "https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+           file://runtest.sh \
+           file://ippool.service \
+           file://ippool_usl_timer.patch \
+           file://ippool_parallel_make_and_pic.patch \
+           file://ippool_init.d.patch \
+           file://always_syslog.patch \
+           file://makefile-add-ldflags.patch \
+           file://0001-usl_timer-Check-for-return-value-of-write-API.patch \
+           "
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f"
 SRC_URI[md5sum] = "e2401e65db26a3764585b97212888fae"
@@ -50,7 +50,7 @@ do_compile_prepend() {
 
     # ignore the OPT_CFLAGS?= in Makefile,
     # it should be in CFLAGS from env
-    export OPT_CFLAGS=
+    export OPT_CFLAGS="${SELECTED_OPTIMIZATION}"
 }
 
 
Signature · 1 line
2.13.3
author
#1 lore raw

PATCH 2/4 flashrom: Upgrade to 0.9.9

Fix build with musl along way

---
 .../flashrom/0001-Fix-compilation-on-aarch64.patch |  62 -------
 .../0001-ichspi.c-Fix-build-with-clang.patch       |  29 ---
 ...fine-_XOPEN_SOURCE-to-enable-ffs-libc-API.patch |  28 +++
 ...utological-pointer-compare-when-using-cla.patch |  35 ----
 .../0003-remove-duplicate-const-qualifiers.patch   |  71 --------
 .../recipes-extended/flashrom/flashrom/sst26.patch | 198 +++++++++++++++++++++
 .../recipes-extended/flashrom/flashrom_0.9.6.1.bb  |  22 ---
 .../recipes-extended/flashrom/flashrom_0.9.9.bb    |  19 ++
 8 files changed, 245 insertions(+), 219 deletions(-)
 delete mode 100644 meta-oe/recipes-extended/flashrom/flashrom/0001-Fix-compilation-on-aarch64.patch
 delete mode 100644 meta-oe/recipes-extended/flashrom/flashrom/0001-ichspi.c-Fix-build-with-clang.patch
 create mode 100644 meta-oe/recipes-extended/flashrom/flashrom/0001-spi-Define-_XOPEN_SOURCE-to-enable-ffs-libc-API.patch
 delete mode 100644 meta-oe/recipes-extended/flashrom/flashrom/0002-Disable-Wtautological-pointer-compare-when-using-cla.patch
 delete mode 100644 meta-oe/recipes-extended/flashrom/flashrom/0003-remove-duplicate-const-qualifiers.patch
 create mode 100644 meta-oe/recipes-extended/flashrom/flashrom/sst26.patch
 delete mode 100644 meta-oe/recipes-extended/flashrom/flashrom_0.9.6.1.bb
 create mode 100644 meta-oe/recipes-extended/flashrom/flashrom_0.9.9.bb
meta-oe/recipes-extended/flashrom/flashrom/0001-Fix-compilation-on-aarch64.patch deleted +0 -62
deleted file mode 100644
index 6c2f64ed9..000000000
@@ -1,62 +0,0 @@
-From d9e4dc750dc45e42b482d744829254a3672c11b3 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Wed, 19 Oct 2016 00:24:08 +0000
-Subject: [PATCH 1/3] Fix compilation on aarch64
-
-Signed-off-by: Khem Raj <[email protected]>
----
- arch.h     | 2 +-
- hwaccess.c | 2 +-
- hwaccess.h | 6 +++---
- 3 files changed, 5 insertions(+), 5 deletions(-)
-
-Index: flashrom-0.9.6.1/arch.h
-===================================================================
---- flashrom-0.9.6.1.orig/arch.h
-+++ flashrom-0.9.6.1/arch.h
-@@ -27,7 +27,7 @@
- #define __FLASHROM_ARCH__ "mips"
- #elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__)
- #define __FLASHROM_ARCH__ "ppc"
--#elif defined(__arm__)
-+#elif defined(__arm__) || defined(__aarch64__)
- #define __FLASHROM_ARCH__ "arm"
- #endif
- __FLASHROM_ARCH__
-Index: flashrom-0.9.6.1/hwaccess.c
-===================================================================
---- flashrom-0.9.6.1.orig/hwaccess.c
-+++ flashrom-0.9.6.1/hwaccess.c
-@@ -121,7 +121,7 @@ int rget_io_perms(void)
- 	return 0;
- }
- 
--#elif defined (__arm__)
-+#elif defined (__arm__) || defined (__aarch64__)
- 
- static inline void sync_primitive(void)
- {
-Index: flashrom-0.9.6.1/hwaccess.h
-===================================================================
---- flashrom-0.9.6.1.orig/hwaccess.h
-+++ flashrom-0.9.6.1/hwaccess.h
-@@ -68,8 +68,8 @@
- #error Little-endian PowerPC #defines are unknown
- #endif
- 
--#elif defined (__arm__)
--#if defined (__ARMEL__)
-+#elif defined (__arm__) || defined (__aarch64__)
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define __FLASHROM_LITTLE_ENDIAN__ 1
- #else
- #error Big-endian ARM #defines are unknown
-@@ -337,7 +337,7 @@ int libpayload_wrmsr(int addr, msr_t msr
- 
- /* PCI port I/O is not yet implemented on MIPS. */
- 
--#elif defined(__arm__)
-+#elif defined(__arm__) || defined (__aarch64__)
- 
- /* Non memory mapped I/O is not supported on ARM. */
- 
meta-oe/recipes-extended/flashrom/flashrom/0001-ichspi.c-Fix-build-with-clang.patch deleted +0 -29
deleted file mode 100644
index ff16f0b11..000000000
@@ -1,29 +0,0 @@
-From a2f603c54013cd0b04bb0103dc615644f315d5e8 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Tue, 15 Nov 2016 17:39:24 +0000
-Subject: [PATCH] ichspi.c: Fix build with clang
-
-ichspi.c:1130:24: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
-        static const uint32_t const dec_berase[4] = {
-                              ^
-Signed-off-by: Khem Raj <[email protected]>
----
- ichspi.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/ichspi.c b/ichspi.c
-index 0223ae3..e47aebd 100644
---- a/ichspi.c
-+++ b/ichspi.c
-@@ -1127,7 +1127,7 @@ static void ich_hwseq_set_addr(uint32_t addr)
- static uint32_t ich_hwseq_get_erase_block_size(unsigned int addr)
- {
- 	uint8_t enc_berase;
--	static const uint32_t const dec_berase[4] = {
-+	static const uint32_t dec_berase[4] = {
- 		256,
- 		4 * 1024,
- 		8 * 1024,
--- 
-1.9.1
-
meta-oe/recipes-extended/flashrom/flashrom/0001-spi-Define-_XOPEN_SOURCE-to-enable-ffs-libc-API.patch new file +28 -0
new file mode 100644
index 000000000..4170fefd2
@@ -0,0 +1,28 @@
+From 7c65a465a3ddeb7afb9a7c49d010ae7e5d5b1ad1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 18 Jul 2017 20:25:49 -0700
+Subject: [PATCH] spi: Define _XOPEN_SOURCE to enable ffs() libc API
+
+musl exposes this issue
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ spi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/spi.c b/spi.c
+index 894f73f..aeb6518 100644
+--- a/spi.c
++++ b/spi.c
+@@ -21,7 +21,7 @@
+ /*
+  * Contains the generic SPI framework
+  */
+-
++#define _XOPEN_SOURCE
+ #include <strings.h>
+ #include <string.h>
+ #include "flash.h"
+-- 
+2.13.3
+
meta-oe/recipes-extended/flashrom/flashrom/0002-Disable-Wtautological-pointer-compare-when-using-cla.patch deleted +0 -35
deleted file mode 100644
index aec11bffa..000000000
@@ -1,35 +0,0 @@
-From 9be0d152dfe8ac0f9b665d61aeb3f99dae533e0f Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Wed, 19 Oct 2016 00:25:09 +0000
-Subject: [PATCH 2/3] Disable Wtautological-pointer-compare when using clang
-
-Signed-off-by: Khem Raj <[email protected]>
----
- flashrom.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/flashrom.c b/flashrom.c
-index 04e9934..bf49104 100644
---- a/flashrom.c
-+++ b/flashrom.c
-@@ -1569,6 +1569,9 @@ int selfcheck(void)
- 	 * For 'flashchips' we check the first element to be non-null. In the
- 	 * other cases there exist use cases where the first element can be
- 	 * null. */
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
-+
- 	if (flashchips == NULL || flashchips[0].vendor == NULL) {
- 		msg_gerr("Flashchips table miscompilation!\n");
- 		ret = 1;
-@@ -1602,6 +1605,7 @@ int selfcheck(void)
- 		msg_gerr("Known laptops table does not exist!\n");
- 		ret = 1;
- 	}
-+#pragma clang diagnostic pop
- #endif
- 	return ret;
- }
--- 
-1.9.1
-
meta-oe/recipes-extended/flashrom/flashrom/0003-remove-duplicate-const-qualifiers.patch deleted +0 -71

71 lines not on this page · raw message

meta-oe/recipes-extended/flashrom/flashrom/sst26.patch new file +198 -0

198 lines not on this page · raw message

meta-oe/recipes-extended/flashrom/flashrom_0.9.6.1.bb deleted +0 -22
deleted file mode 100644
index 0edc68820..000000000
@@ -1,22 +0,0 @@
-DESCRIPTION = "flashrom is a utility for identifying, reading, writing, verifying and erasing flash chips"
-LICENSE = "GPLv2"
-HOMEPAGE = "http://flashrom.org"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-DEPENDS = "pciutils"
-
-SRC_URI = "http://download.flashrom.org/releases/flashrom-${PV}.tar.bz2 \
-           file://0001-Fix-compilation-on-aarch64.patch \
-           file://0002-Disable-Wtautological-pointer-compare-when-using-cla.patch \
-           file://0003-remove-duplicate-const-qualifiers.patch \
-           file://0001-ichspi.c-Fix-build-with-clang.patch \
-           "
-
-SRC_URI[md5sum] = "407e836c0a2b17ec76583cb6809f65e5"
-SRC_URI[sha256sum] = "6f7b588cce74c90b4fe9c9c794de105de76e0323442fb5770b1aeab81e9d560a"
-
-CFLAGS += "-Wno-error=unknown-pragmas"
-
-do_install() {
-    oe_runmake PREFIX=${prefix} DESTDIR=${D} install
-}
meta-oe/recipes-extended/flashrom/flashrom_0.9.9.bb new file +19 -0
new file mode 100644
index 000000000..1bd97929c
@@ -0,0 +1,19 @@
+DESCRIPTION = "flashrom is a utility for identifying, reading, writing, verifying and erasing flash chips"
+LICENSE = "GPLv2"
+HOMEPAGE = "http://flashrom.org"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+DEPENDS = "pciutils libusb"
+
+SRC_URI = "http://download.flashrom.org/releases/flashrom-${PV}.tar.bz2 \
+           file://0001-spi-Define-_XOPEN_SOURCE-to-enable-ffs-libc-API.patch \
+           file://sst26.patch \
+           "
+SRC_URI[md5sum] = "aab9c98925d9cfb5ffb28b67a6112530"
+SRC_URI[sha256sum] = "cb3156b0f63eb192024b76c0814135930297aac41f80761a5d293de769783c45"
+
+inherit pkgconfig
+
+do_install() {
+    oe_runmake PREFIX=${prefix} DESTDIR=${D} install
+}
Signature · 1 line
2.13.3
author
#2 lore raw

PATCH 3/4 postgresql: Do not link with libnsl on musl

In reply to Khem Raj

libnsl is not available on musl

---
 meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb +4 -0
index e4d2edad0..7043b272a 100644
@@ -7,5 +7,9 @@ SRC_URI += "\
     file://not-check-libperl.patch \
 "
 
+do_compile_prepend_libc-musl() {
+    sed -i -e 's/\-lnsl//g' ${B}/src/Makefile.global
+}
+
 SRC_URI[md5sum] = "2fee03f2034034dbfcb3321a0bb0f829"
 SRC_URI[sha256sum] = "e3eb51d045c180b03d2de1f0c3af9356e10be49448e966ca01dfc2c6d1cc9d23"
Signature · 1 line
2.13.3
author
#3 lore raw

PATCH 4/4 zeroconf: Fix build with musl

In reply to Khem Raj
---
 ...name-arp_op-to-avoid-namespace-conflicts-.patch | 69 ++++++++++++++++++++++
 .../recipes-protocols/zeroconf/zeroconf_0.9.bb     |  4 +-
 2 files changed, 72 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch
meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch new file +69 -0
new file mode 100644
index 000000000..b4d6d94b0
@@ -0,0 +1,69 @@
+From 549773fdaf1fb003b84f25df386a07d299cdeb3e Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 18 Jul 2017 21:25:33 -0700
+Subject: [PATCH] zeroconf: Rename arp_op to avoid namespace conflicts with C
+ library
+
+on musl e.g. we get
+In file included from /mnt/a/oe/build/tmp/work/corei7-64-bec-linux-musl/zeroconf/0.9-r1/recipe-sysroot/usr/include/net/ethernet.h:10:0,
+
+This is because in musl arp_op is a define which is included
+and causes the conflict
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ zeroconf.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/zeroconf.c b/zeroconf.c
+index 812d34b..f27e907 100644
+--- a/zeroconf.c
++++ b/zeroconf.c
+@@ -14,8 +14,6 @@
+ 
+ #include <sys/types.h>
+ #include <sys/socket.h>
+-#include <linux/rtnetlink.h>
+-#include <linux/if.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -34,6 +32,8 @@
+ #include <sys/time.h>
+ #include <signal.h>
+ #include <limits.h>
++#include <linux/rtnetlink.h>
++#include <linux/if.h>
+ 
+ #include "delay.h"
+ 
+@@ -108,7 +108,7 @@ int  arp_conflict(struct intf *intf, struct arp_packet *pkt);
+ void arp_packet_dump(struct arp_packet *pkt);
+ void arp_packet_send(int as,
+ 		     struct intf *intf,
+-		     short int arp_op,
++		     short int arpop,
+ 		     int null_sender);
+ void arp_probe(int as, struct intf *intf);
+ void arp_claim(int as, struct intf *intf);
+@@ -1591,7 +1591,7 @@ int  arp_conflict(struct intf *intf, struct arp_packet *pkt)
+ 
+ void arp_packet_send(int as,
+ 		     struct intf *intf,
+-		     short int arp_op,
++		     short int arpop,
+ 		     int null_sender)
+ {
+ 
+@@ -1605,7 +1605,7 @@ void arp_packet_send(int as,
+   ap.arp.ar_pro = htons(ARP_IP_PROTO);
+   ap.arp.ar_hln = ETH_ALEN;
+   ap.arp.ar_pln = 4; /* octets in IPv4 address */
+-  ap.arp.ar_op = htons(arp_op);
++  ap.arp.ar_op = htons(arpop);
+ 
+   /* filling with 0xff sets the destination to
+    * the broadcast link-layer address for free
+-- 
+2.13.3
+
meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb +3 -1
index 13f9b9b9a..753d83298 100644
@@ -20,7 +20,9 @@ SRC_URI = "http://www.progsoc.org/~wildfire/zeroconf/download/${BPN}-${PV}.tar.g
            file://compilefix.patch \
            file://makefile-add-ldflags.patch \
            file://zeroconf-default \
-           file://debian-zeroconf"
+           file://debian-zeroconf \
+           file://0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch \
+           "
 
 SRC_URI[md5sum] = "bdafb16b008ebb5633e4e581f77821d2"
 SRC_URI[sha256sum] = "a8c74df127753e2310fa1e072f3c9ca44a404bb0bbce9cfec7a84c6dff8bec7b"
Signature · 1 line
2.13.3
#4 lore raw
In reply to Khem Raj

I've dropped this from master-next to check if the build failures we were discussing were caused by this. Did you change anything in here (is it v2 or just resend)?

Quoted 98 lines · Khem Raj
---
 ...timer-Check-for-return-value-of-write-API.patch | 28
++++++++++++++++++++++
 .../recipes-daemons/ippool/ippool_1.3.bb           | 22 ++++++++---------
 2 files changed, 39 insertions(+), 11 deletions(-)
 create mode 100644 meta-networking/recipes-daemons/ippool/ippool/0001-

usl_timer-Check-for-return-value-of-write-API.patch

(quoted diff) +0 -0

usl_timer-Check-for-return-value-of-write-API.patch b/meta-networking/recipes-daemons/ippool/ippool/0001- usl_timer-Check-for-return-value-of-write-API.patch new file mode 100644
index 000000000..6fb7cc5c4

meta-networking/recipes-daemons/ippool/ippool/0001- new file +0 -0

usl_timer-Check-for-return-value-of-write-API.patch

meta-networking/recipes-daemons/ippool/ippool/0001- new file +20 -0
@@ -0,0 +1,28 @@
+From 5d7f20c045b3c74dad2c53d65e30bd4840250082 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 27 Jun 2017 15:17:19 -0700
+Subject: [PATCH] usl_timer: Check for return value of write() API
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ usl/usl_timer.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/usl/usl_timer.c b/usl/usl_timer.c
+index fda752b..d8414a6 100644
+--- a/usl/usl_timer.c
++++ b/usl/usl_timer.c
+@@ -94,7 +94,9 @@ void usl_timer_tick(void)
+
+       if (!usl_tick_pending) {
+               usl_tick_pending = 1;
+-              write(usl_tick_pipe[1], &msg, sizeof(msg));
++              if (write(usl_tick_pipe[1], &msg, sizeof(msg)) !=

sizeof(msg)) {
++ fprintf(stderr, "write to fd %i failed: %s\n",
usl_tick_pipe[1], strerror(errno));
++ }

meta-networking/recipes-daemons/ippool/ippool/0001- new file +6 -0
+       }
+ }
+
+--
+2.13.2
+
meta-networking/recipes-daemons/ippool/ippool_1.3.bb +10 -10
index 969f434cc..e1c9215ca 100644
@@ -11,16 +11,16 @@ HOMEPAGE = "http://www.openl2tp.org/"
 SECTION = "console/network"
 LICENSE = "GPLv2+"
 
-SRC_URI = "\
-        https://sourceforge.net/projects/openl2tp/files/${BPN}
 /${PV}/${BPN}-${PV}.tar.gz \
-        file://ippool_usl_timer.patch \
-        file://ippool_parallel_make_and_pic.patch \
-        file://ippool_init.d.patch \
-        file://always_syslog.patch \
-        file://makefile-add-ldflags.patch \
-        file://runtest.sh \
-        file://ippool.service \
-        "
+SRC_URI = "https://sourceforge.net/projects/openl2tp/files/${BPN}
 /${PV}/${BPN}-${PV}.tar.gz \
+           file://runtest.sh \
+           file://ippool.service \
+           file://ippool_usl_timer.patch \
+           file://ippool_parallel_make_and_pic.patch \
+           file://ippool_init.d.patch \
+           file://always_syslog.patch \
+           file://makefile-add-ldflags.patch \
+           file://0001-usl_timer-Check-for-return-value-of-write-API.patch
 \
+           "

LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f" SRC_URI[md5sum] = "e2401e65db26a3764585b97212888fae"

meta-networking/recipes-daemons/ippool/ippool_1.3.bb +1 -2
@@ -50,7 +50,7 @@ do_compile_prepend() {
 
     # ignore the OPT_CFLAGS?= in Makefile,
     # it should be in CFLAGS from env
-    export OPT_CFLAGS=
+    export OPT_CFLAGS="${SELECTED_OPTIMIZATION}"
 }
 
 
--

2.13.3

author
#5 lore raw

No changes I thought I never send it out

Quoted 107 lines · Martin Jansa

I've dropped this from master-next to check if the build failures we were discussing were caused by this. Did you change anything in here (is it v2 or just resend)?

Quoted 100 lines · Khem Raj
---
 ...timer-Check-for-return-value-of-write-API.patch | 28
++++++++++++++++++++++
 .../recipes-daemons/ippool/ippool_1.3.bb           | 22
++++++++---------
 2 files changed, 39 insertions(+), 11 deletions(-)
 create mode 100644

meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch

diff --git a/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch b/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch new file mode 100644
index 000000000..6fb7cc5c4
--- /dev/null
+++
b/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch

meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch new file +20 -0
@@ -0,0 +1,28 @@
+From 5d7f20c045b3c74dad2c53d65e30bd4840250082 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 27 Jun 2017 15:17:19 -0700
+Subject: [PATCH] usl_timer: Check for return value of write() API
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ usl/usl_timer.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/usl/usl_timer.c b/usl/usl_timer.c
+index fda752b..d8414a6 100644
+--- a/usl/usl_timer.c
++++ b/usl/usl_timer.c
+@@ -94,7 +94,9 @@ void usl_timer_tick(void)
+
+       if (!usl_tick_pending) {
+               usl_tick_pending = 1;
+-              write(usl_tick_pipe[1], &msg, sizeof(msg));
++              if (write(usl_tick_pipe[1], &msg, sizeof(msg)) !=

sizeof(msg)) {
++ fprintf(stderr, "write to fd %i failed: %s\n",
usl_tick_pipe[1], strerror(errno));
++ }

meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch new file +6 -0
+       }
+ }
+
+--
+2.13.2
+
meta-networking/recipes-daemons/ippool/ippool_1.3.bb +0 -2
index 969f434cc..e1c9215ca 100644
@@ -11,16 +11,16 @@ HOMEPAGE = "http://www.openl2tp.org/"
 SECTION = "console/network"
 LICENSE = "GPLv2+"
 
-SRC_URI = "\
-

https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz
\

meta-networking/recipes-daemons/ippool/ippool_1.3.bb +1 -8
-        file://ippool_usl_timer.patch \
-        file://ippool_parallel_make_and_pic.patch \
-        file://ippool_init.d.patch \
-        file://always_syslog.patch \
-        file://makefile-add-ldflags.patch \
-        file://runtest.sh \
-        file://ippool.service \
-        "
+SRC_URI = "

https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz
\

meta-networking/recipes-daemons/ippool/ippool_1.3.bb +10 -2
+           file://runtest.sh \
+           file://ippool.service \
+           file://ippool_usl_timer.patch \
+           file://ippool_parallel_make_and_pic.patch \
+           file://ippool_init.d.patch \
+           file://always_syslog.patch \
+           file://makefile-add-ldflags.patch \
+
 file://0001-usl_timer-Check-for-return-value-of-write-API.patch \
+           "
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f"
 SRC_URI[md5sum] = "e2401e65db26a3764585b97212888fae"
@@ -50,7 +50,7 @@ do_compile_prepend() {
 
     # ignore the OPT_CFLAGS?= in Makefile,
     # it should be in CFLAGS from env
-    export OPT_CFLAGS=
+    export OPT_CFLAGS="${SELECTED_OPTIMIZATION}"
 }
 
 
--

2.13.3