netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: "Maciej Żenczykowski" <maze@google.com>
Cc: Florian Westphal <fw@strlen.de>,
	Nick Hainke <vincent@systemli.org>,
	Netfilter Development Mailing List 
	<netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH iptables 1/2] xtables: fix compilation with musl
Date: Tue, 17 May 2022 10:14:36 +0200	[thread overview]
Message-ID: <YoNZbOglBKlT8Nwl@orbyte.nwl.cc> (raw)
In-Reply-To: <CANP3RGfoEu5dKV83bO0LYnWYLoJMrvaMaCAx4sYaDNn6-14Z-Q@mail.gmail.com>

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@strlen.de> wrote:
> > Phil Sutter <phil@nwl.cc> 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

  reply	other threads:[~2022-05-17  8:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-14 16:33 [PATCH iptables 1/2] xtables: fix compilation with musl Nick Hainke
2022-05-14 16:33 ` [PATCH iptables 2/2] xshared: " Nick Hainke
2022-05-14 17:09   ` Phil Sutter
2022-05-16  6:47     ` [PATCH] treewide: use uint* instead of u_int* vincent
2022-05-16 10:28       ` Jan Engelhardt
2022-05-16 16:16         ` vincent
2022-05-17  8:10           ` Phil Sutter
2022-05-17  8:14             ` Jan Engelhardt
2022-05-18 13:21               ` Phil Sutter
2022-05-31 21:32                 ` Nick
2022-05-14 17:04 ` [PATCH iptables 1/2] xtables: fix compilation with musl Phil Sutter
2022-05-14 19:14   ` Maciej Żenczykowski
2022-05-15 12:05     ` Phil Sutter
2022-05-15 13:40       ` Maciej Żenczykowski
2022-05-17  8:17         ` Phil Sutter
2022-05-17  8:22           ` Maciej Żenczykowski
2022-05-15 14:09       ` Florian Westphal
2022-05-15 14:13         ` Maciej Żenczykowski
2022-05-17  8:14           ` Phil Sutter [this message]
2022-05-16  6:52       ` Nick
2022-05-16  7:12         ` Maciej Żenczykowski
2022-05-16 16:24           ` [PATCH] " vincent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YoNZbOglBKlT8Nwl@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=fw@strlen.de \
    --cc=maze@google.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=vincent@systemli.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).