[oe,meta-networking,1/7] ebtables: Fix duplicate definition errors due to netinet/ether.h

Message ID 20180304204130.23962-1-raj.khem@gmail.com
State New
Headers show
Series
  • [oe,meta-networking,1/7] ebtables: Fix duplicate definition errors due to netinet/ether.h
Related show

Commit Message

Khem Raj March 4, 2018, 8:41 p.m.
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 .../0001-re-order-including-netinet-ether.h.patch  | 89 ++++++++++++++++++++++
 .../recipes-filter/ebtables/ebtables_2.0.10-4.bb   |  1 +
 2 files changed, 90 insertions(+)
 create mode 100644 meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-re-order-including-netinet-ether.h.patch

-- 
2.16.2

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

Patch

diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-re-order-including-netinet-ether.h.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-re-order-including-netinet-ether.h.patch
new file mode 100644
index 000000000..997c8c5d1
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-re-order-including-netinet-ether.h.patch
@@ -0,0 +1,89 @@ 
+From 65e6ce454751b0d38d29836fcf78a31b612e59c3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 3 Mar 2018 16:38:17 -0800
+Subject: [PATCH] re-order including netinet/ether.h
+
+Fixed duplicate definitions errors seen with glibc 2.27
+
+e.g.
+
+error: redefinition of 'struct sockaddr_in6'
+|  struct sockaddr_in6 {
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ extensions/ebt_among.c    | 3 +--
+ extensions/ebt_arpreply.c | 2 +-
+ extensions/ebt_nat.c      | 2 +-
+ useful_functions.c        | 2 +-
+ 4 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/extensions/ebt_among.c b/extensions/ebt_among.c
+index b096847..e03a4e2 100644
+--- a/extensions/ebt_among.c
++++ b/extensions/ebt_among.c
+@@ -12,10 +12,9 @@
+ #include <getopt.h>
+ #include <ctype.h>
+ #include <unistd.h>
+-#include <netinet/ether.h>
+ #include "../include/ebtables_u.h"
+ #include "../include/ethernetdb.h"
+-#include <linux/if_ether.h>
++#include <netinet/ether.h>
+ #include <linux/netfilter_bridge/ebt_among.h>
+ #include <sys/mman.h>
+ #include <sys/stat.h>
+diff --git a/extensions/ebt_arpreply.c b/extensions/ebt_arpreply.c
+index c5102a4..c3757f3 100644
+--- a/extensions/ebt_arpreply.c
++++ b/extensions/ebt_arpreply.c
+@@ -11,8 +11,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <getopt.h>
+-#include <netinet/ether.h>
+ #include "../include/ebtables_u.h"
++#include <netinet/ether.h>
+ #include <linux/netfilter_bridge/ebt_arpreply.h>
+ 
+ static int mac_supplied;
+diff --git a/extensions/ebt_nat.c b/extensions/ebt_nat.c
+index 8d318d1..e6afbf8 100644
+--- a/extensions/ebt_nat.c
++++ b/extensions/ebt_nat.c
+@@ -10,8 +10,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <getopt.h>
+-#include <netinet/ether.h>
+ #include "../include/ebtables_u.h"
++#include <netinet/ether.h>
+ #include <linux/netfilter_bridge/ebt_nat.h>
+ 
+ static int to_source_supplied, to_dest_supplied;
+diff --git a/useful_functions.c b/useful_functions.c
+index c304f4d..a447db5 100644
+--- a/useful_functions.c
++++ b/useful_functions.c
+@@ -23,7 +23,6 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ #include <stdio.h>
+-#include <netinet/ether.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <getopt.h>
+@@ -33,6 +32,7 @@
+ #include <arpa/inet.h>
+ #include "include/ebtables_u.h"
+ #include "include/ethernetdb.h"
++#include <netinet/ether.h>
+ 
+ const unsigned char mac_type_unicast[ETH_ALEN] =   {0,0,0,0,0,0};
+ const unsigned char msk_type_unicast[ETH_ALEN] =   {1,0,0,0,0,0};
+-- 
+2.16.2
+
diff --git a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
index d5e7341a0..7c89cffa9 100644
--- a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
+++ b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
@@ -30,6 +30,7 @@  SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \
            file://0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch \
            file://0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch \
            file://0010-Adjust-header-include-sequence.patch \
+           file://0001-re-order-including-netinet-ether.h.patch \
            "
 
 SRC_URI[md5sum] = "506742a3d44b9925955425a659c1a8d0"