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-w32-5fa6d1a632505789409a2ba6cf8e112529f9db18.tar.gz
busybox-w32-5fa6d1a632505789409a2ba6cf8e112529f9db18.tar.bz2
busybox-w32-5fa6d1a632505789409a2ba6cf8e112529f9db18.zip
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 @@
64#define BRCTL_USE_INTERNAL 1 64#define BRCTL_USE_INTERNAL 1
65 65
66#if ENABLE_FEATURE_BRCTL_FANCY 66#if ENABLE_FEATURE_BRCTL_FANCY
67# include <linux/if_bridge.h> 67/* #include <linux/if_bridge.h>
68 * breaks on musl: we already included netinet/in.h in libbb.h,
69 * if we include <linux/if_bridge.h> here, we get this:
70 * In file included from /usr/include/linux/if_bridge.h:18,
71 * from networking/brctl.c:67:
72 * /usr/include/linux/in6.h:32: error: redefinition of 'struct in6_addr'
73 * /usr/include/linux/in6.h:49: error: redefinition of 'struct sockaddr_in6'
74 * /usr/include/linux/in6.h:59: error: redefinition of 'struct ipv6_mreq'
75 */
76/* From <linux/if_bridge.h> */
77#define BRCTL_GET_VERSION 0
78#define BRCTL_GET_BRIDGES 1
79#define BRCTL_ADD_BRIDGE 2
80#define BRCTL_DEL_BRIDGE 3
81#define BRCTL_ADD_IF 4
82#define BRCTL_DEL_IF 5
83#define BRCTL_GET_BRIDGE_INFO 6
84#define BRCTL_GET_PORT_LIST 7
85#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
86#define BRCTL_SET_BRIDGE_HELLO_TIME 9
87#define BRCTL_SET_BRIDGE_MAX_AGE 10
88#define BRCTL_SET_AGEING_TIME 11
89#define BRCTL_SET_GC_INTERVAL 12
90#define BRCTL_GET_PORT_INFO 13
91#define BRCTL_SET_BRIDGE_STP_STATE 14
92#define BRCTL_SET_BRIDGE_PRIORITY 15
93#define BRCTL_SET_PORT_PRIORITY 16
94#define BRCTL_SET_PATH_COST 17
95#define BRCTL_GET_FDB_ENTRIES 18
96struct __bridge_info {
97 uint64_t designated_root;
98 uint64_t bridge_id;
99 uint32_t root_path_cost;
100 uint32_t max_age;
101 uint32_t hello_time;
102 uint32_t forward_delay;
103 uint32_t bridge_max_age;
104 uint32_t bridge_hello_time;
105 uint32_t bridge_forward_delay;
106 uint8_t topology_change;
107 uint8_t topology_change_detected;
108 uint8_t root_port;
109 uint8_t stp_enabled;
110 uint32_t ageing_time;
111 uint32_t gc_interval;
112 uint32_t hello_timer_value;
113 uint32_t tcn_timer_value;
114 uint32_t topology_change_timer_value;
115 uint32_t gc_timer_value;
116};
117/* end <linux/if_bridge.h> */
68 118
69/* FIXME: These 4 funcs are not really clean and could be improved */ 119/* FIXME: These 4 funcs are not really clean and could be improved */
70static ALWAYS_INLINE void bb_strtotimeval(struct timeval *tv, 120static 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 @@
38#include <linux/mii.h> 38#include <linux/mii.h>
39#include <linux/ethtool.h> 39#include <linux/ethtool.h>
40#ifdef HAVE_NET_ETHERNET_H 40#ifdef HAVE_NET_ETHERNET_H
41# include <net/ethernet.h> 41/* musl breakage:
42 * In file included from /usr/include/net/ethernet.h:10,
43 * from networking/ifplugd.c:41:
44 * /usr/include/netinet/if_ether.h:96: error: redefinition of 'struct ethhdr'
45 *
46 * Build succeeds without it on musl. Commented it out.
47 * If on your system you need it, consider removing <linux/ethtool.h>
48 * and copy-pasting its definitions here (<linux/ethtool.h> is what pulls in
49 * conflicting definition of struct ethhdr on musl).
50 */
51/* # include <net/ethernet.h> */
42#endif 52#endif
43#include <linux/netlink.h> 53#include <linux/netlink.h>
44#include <linux/rtnetlink.h> 54#include <linux/rtnetlink.h>