Re: [PATCH iptables 1/2] xtables: fix compilation with musl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 15, 2022 at 07:13:27AM -0700, Maciej Żenczykowski wrote:
> On Sun, May 15, 2022 at 7:09 AM Florian Westphal <fw@xxxxxxxxx> wrote:
> > Phil Sutter <phil@xxxxxx> wrote:
> > > > fix build for missing ETH_ALEN definition
> > > > (this is needed at least with bionic)
> > > >
> > > > +#include <linux/if_ether.h> /* ETH_ALEN */
> > > >
> > > > Based on the above, clearly adding an 'if defined GLIBC' wrapper will
> > > > break bionic...
> > > > and presumably glibc doesn't care whether the #include is done one way
> > > > or the other?
> > >
> > > With glibc, netinet/ether.h includes netinet/if_ether.h which in turn
> > > includes linux/if_ether.h where finally ETH_ALEN is defined.
> > >
> > > In xtables.c we definitely need netinet/ether.h for ether_aton()
> > > declaration.
> >
> > Or we hand-roll a xt_ether_aton and add XT_ETH_ALEN to avoid
> > this include.
> >
> > Probably easier to maintain than to add all these ifdefs?
> 
> or even simply replace both the #include's with
> #ifndef ETH_ALEN
> #define ETH_ALEN 6
> #endif

If that's sufficient for both musl and bionic, probably the easiest
solution with least potential for surprises.

Cheers, Phil



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux