diff mbox series

[ebtables] Fix musl libc compatibility

Message ID 8937525032a5846343b9dc6e4bd7d767ee5236eb.1525427212.git.baruch@tkos.co.il
State Accepted
Delegated to: Pablo Neira
Headers show
Series [ebtables] Fix musl libc compatibility | expand

Commit Message

Baruch Siach May 4, 2018, 9:46 a.m. UTC
Conflicting definitions of struct ethhdr between the kernel and musl
libc provides headers causes a build failure:

In file included from .../usr/include/netinet/ether.h:8:0,
                 from useful_functions.c:28:
.../usr/include/netinet/if_ether.h:107:8: error: redefinition of ‘struct ethhdr’
 struct ethhdr {
        ^~~~~~
In file included from include/linux/netfilter_bridge.h:8:0,
                 from include/linux/netfilter_bridge/ebtables.h:17,
                 from include/ebtables_u.h:27,
                 from useful_functions.c:25:
include/linux/if_ether.h:119:8: note: originally defined here
 struct ethhdr {
        ^~~~~~

Recent enough versions kernel headers allow the libc to suppress
conflicting kernel definitions. Include the libc proivded
netinet/ether.h before kernel headers to suppress the conflicting
definition of struct ethhdr.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 include/ebtables_u.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Pablo Neira Ayuso May 8, 2018, 12:33 p.m. UTC | #1
On Fri, May 04, 2018 at 12:46:52PM +0300, Baruch Siach wrote:
> Conflicting definitions of struct ethhdr between the kernel and musl
> libc provides headers causes a build failure:
> 
> In file included from .../usr/include/netinet/ether.h:8:0,
>                  from useful_functions.c:28:
> .../usr/include/netinet/if_ether.h:107:8: error: redefinition of ‘struct ethhdr’
>  struct ethhdr {
>         ^~~~~~
> In file included from include/linux/netfilter_bridge.h:8:0,
>                  from include/linux/netfilter_bridge/ebtables.h:17,
>                  from include/ebtables_u.h:27,
>                  from useful_functions.c:25:
> include/linux/if_ether.h:119:8: note: originally defined here
>  struct ethhdr {
>         ^~~~~~
> 
> Recent enough versions kernel headers allow the libc to suppress
> conflicting kernel definitions. Include the libc proivded
> netinet/ether.h before kernel headers to suppress the conflicting
> definition of struct ethhdr.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/include/ebtables_u.h b/include/ebtables_u.h
index c8589969bd8e..4824a145964e 100644
--- a/include/ebtables_u.h
+++ b/include/ebtables_u.h
@@ -24,6 +24,7 @@ 
 #ifndef EBTABLES_U_H
 #define EBTABLES_U_H
 #include <netinet/in.h>
+#include <netinet/ether.h>
 #include <linux/netfilter_bridge/ebtables.h>
 #include <linux/netfilter/x_tables.h>