From 5fa6d1a632505789409a2ba6cf8e112529f9db18 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 5 Oct 2015 11:15:43 +0200 Subject: Aboriginal linux/musl build fixes Signed-off-by: Denys Vlasenko --- networking/brctl.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- networking/ifplugd.c | 12 +++++++++++- 2 files changed, 62 insertions(+), 2 deletions(-) (limited to 'networking') diff --git a/networking/brctl.c b/networking/brctl.c index 207b069..8043d60 100644 --- a/networking/brctl.c +++ b/networking/brctl.c @@ -64,7 +64,57 @@ #define BRCTL_USE_INTERNAL 1 #if ENABLE_FEATURE_BRCTL_FANCY -# include +/* #include + * breaks on musl: we already included netinet/in.h in libbb.h, + * if we include 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 */ +#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 */ /* 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 fef7a5a..1e6c562 100644 --- a/networking/ifplugd.c +++ b/networking/ifplugd.c @@ -38,7 +38,17 @@ #include #include #ifdef HAVE_NET_ETHERNET_H -# include +/* 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 + * and copy-pasting its definitions here ( is what pulls in + * conflicting definition of struct ethhdr on musl). + */ +/* # include */ #endif #include #include -- cgit v1.1