From 96a2c0c1629f05d452af32c809f30bc4d0c3220e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 2 Feb 2018 23:28:33 -0800
Subject: [PATCH] bnx2x.c: Reorder the includes to avoid duplicate defines with
musl
including nic.h before linux/ethtool.h avoids redefinitions of
eth structs
/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.876-r0/recipe-sysroot/
usr/include/netinet/if_ether.h:104:8: error: redefinition of 'struct ethhdr'
struct ethhdr {
^~~~~~
In file included from /mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.
876-r0/recipe-sysroot/usr/include/linux/ethtool.h:19:0,
from qedi.c:52:
/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.876-r0/recipe-sysroot/
usr/include/linux/if_ether.h:154:8: note: originally defined here
struct ethhdr {
^~~~~~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
iscsiuio/src/unix/libs/bnx2x.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c
index 3df6d5fdbfa2..c5e7b7191811 100644
--- a/iscsiuio/src/unix/libs/bnx2x.c
+++ b/iscsiuio/src/unix/libs/bnx2x.c
@@ -36,6 +36,11 @@
* bnx2x.c - bnx2x user space driver
*
*/
+
+/* include nic.h before linux/ethtool.h to avoid redefinitions of
+ * eth structs
+*/
+#include "nic.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
@@ -58,7 +63,6 @@
#include "bnx2x.h"
#include "cnic.h"
#include "logger.h"
-#include "nic.h"
#include "nic_id.h"
#include "nic_utils.h"
#include "options.h"
--
2.17.2