aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-10-05 11:15:43 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-10-05 11:15:43 +0200
commit5fa6d1a632505789409a2ba6cf8e112529f9db18 (patch)
tree9666bad5a3b4ebd4c9dfabbe5b0f67617e075c00 /networking
parent12efcf3285a75d197704d2eef23824b3e4f11e66 (diff)
downloadbusybox-5fa6d1a632505789409a2ba6cf8e112529f9db18.tar.gz
Aboriginal linux/musl build fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/brctl.c52
-rw-r--r--networking/ifplugd.c12
2 files changed, 62 insertions, 2 deletions
diff --git a/networking/brctl.c b/networking/brctl.c
index 207b069aa..8043d600b 100644
--- a/networking/brctl.c
+++ b/networking/brctl.c
@@ -64,7 +64,57 @@
#define BRCTL_USE_INTERNAL 1
#if ENABLE_FEATURE_BRCTL_FANCY
-# include <linux/if_bridge.h>
+/* #include <linux/if_bridge.h>
+ * breaks on musl: we already included netinet/in.h in libbb.h,
+ * if we include <linux/if_bridge.h> here, we get this:
+ * In file included from /usr/include/linux/if_bridge.h:18,
+ * from networking/brctl.c:67:
+ * /usr/include/linux/in6.h:32: error: redefinition of 'struct in6_addr'
+ * /usr/include/linux/in6.h:49: error: redefinition of 'struct sockaddr_in6'
+ * /usr/include/linux/in6.h:59: error: redefinition of 'struct ipv6_mreq'
+ */
+/* From <linux/if_bridge.h> */
+#define BRCTL_GET_VERSION 0
+#define BRCTL_GET_BRIDGES 1
+#define BRCTL_ADD_BRIDGE 2
+#define BRCTL_DEL_BRIDGE 3
+#define BRCTL_ADD_IF 4
+#define BRCTL_DEL_IF 5
+#define BRCTL_GET_BRIDGE_INFO 6
+#define BRCTL_GET_PORT_LIST 7
+#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
+#define BRCTL_SET_BRIDGE_HELLO_TIME 9
+#define BRCTL_SET_BRIDGE_MAX_AGE 10
+#define BRCTL_SET_AGEING_TIME 11
+#define BRCTL_SET_GC_INTERVAL 12
+#define BRCTL_GET_PORT_INFO 13
+#define BRCTL_SET_BRIDGE_STP_STATE 14
+#define BRCTL_SET_BRIDGE_PRIORITY 15
+#define BRCTL_SET_PORT_PRIORITY 16
+#define BRCTL_SET_PATH_COST 17
+#define BRCTL_GET_FDB_ENTRIES 18
+struct __bridge_info {
+ uint64_t designated_root;
+ uint64_t bridge_id;
+ uint32_t root_path_cost;
+ uint32_t max_age;
+ uint32_t hello_time;
+ uint32_t forward_delay;
+ uint32_t bridge_max_age;
+ uint32_t bridge_hello_time;
+ uint32_t bridge_forward_delay;
+ uint8_t topology_change;
+ uint8_t topology_change_detected;
+ uint8_t root_port;
+ uint8_t stp_enabled;
+ uint32_t ageing_time;
+ uint32_t gc_interval;
+ uint32_t hello_timer_value;
+ uint32_t tcn_timer_value;
+ uint32_t topology_change_timer_value;
+ uint32_t gc_timer_value;
+};
+/* end <linux/if_bridge.h> */
/* FIXME: These 4 funcs are not really clean and could be improved */
static ALWAYS_INLINE void bb_strtotimeval(struct timeval *tv,
diff --git a/networking/ifplugd.c b/networking/ifplugd.c
index fef7a5ac9..1e6c562e0 100644
--- a/networking/ifplugd.c
+++ b/networking/ifplugd.c
@@ -38,7 +38,17 @@
#include <linux/mii.h>
#include <linux/ethtool.h>
#ifdef HAVE_NET_ETHERNET_H
-# include <net/ethernet.h>
+/* musl breakage:
+ * In file included from /usr/include/net/ethernet.h:10,
+ * from networking/ifplugd.c:41:
+ * /usr/include/netinet/if_ether.h:96: error: redefinition of 'struct ethhdr'
+ *
+ * Build succeeds without it on musl. Commented it out.
+ * If on your system you need it, consider removing <linux/ethtool.h>
+ * and copy-pasting its definitions here (<linux/ethtool.h> is what pulls in
+ * conflicting definition of struct ethhdr on musl).
+ */
+/* # include <net/ethernet.h> */
#endif
#include <linux/netlink.h>
#include <linux/rtnetlink.h>