mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Isaac Dunham <idunham@lavabit.com>
To: musl@lists.openwall.com
Subject: Re: Clash between 'netinet/if_ether.h' and 'linux/if_ether.h'
Date: Tue, 9 Oct 2012 17:08:14 -0700	[thread overview]
Message-ID: <20121009170814.1df8e187.idunham@lavabit.com> (raw)
In-Reply-To: <20121009231553.GQ254@brightrain.aerifal.cx>

On Tue, 9 Oct 2012 19:15:53 -0400
Rich Felker <dalias@aerifal.cx> wrote:

> On Tue, Oct 09, 2012 at 04:13:43PM -0700, Isaac Dunham wrote:
> > > It's a bug to be including linux/if_ether.h, and there's no way to
> > > work around this without depending on kernel headers, which musl will
> > 
> > Patch that does work around it:
> > 
> > -#ifndef _NETINET_IF_ETHER_H
> > +/* Check for <linux/if_ether.h> - _LINUX_IF_ETHER_H will also work */
> > +#if !defined(_NETINET_IF_ETHER_H) || !defined(ETH_ALEN)
> > #define _NETINET_IF_ETHER_H
> > +#define _LINUX_IF_ETHER_H /* linux/if_ether.h defines the same stuff */
> 
> That is a clever workaround, but the way it's written it breaks
> include-guard heuristics. Instead, it should be..
> 
> #ifndef _NETINET_IF_ETHER_H
> #define _NETINET_IF_ETHER_H
> 
> #ifndef ETH_ALEN
> ...
> #endif
> 
> #endif
> 
> But does it work the other way around, i.e. if <netinet/if_ether.h> is
> included first?
That's what the second change is for:
> > +#define _LINUX_IF_ETHER_H /* linux/if_ether.h defines the same stuff */

> I'd still rather just press upstream to fix this stupid bug if we can.
> This is the kind of thing that only affects a small number of broken
> applications, and as such, I really question whether it merits ugly
> workarounds.

Agreed. I mainly mentioned that because I take "*can't* do <xyz> without <abc>" as a challenge.

-- 
Isaac Dunham <idunham@lavabit.com>



  reply	other threads:[~2012-10-10  0:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 22:45 Abdoulaye Walsimou GAYE
2012-10-08 23:33 ` Rich Felker
2012-10-09 23:13   ` Isaac Dunham
2012-10-09 23:15     ` Rich Felker
2012-10-10  0:08       ` Isaac Dunham [this message]
2012-10-10 20:06   ` Abdoulaye Walsimou GAYE
2012-10-11  0:01     ` Rich Felker
2012-10-11  4:36       ` idunham

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=20121009170814.1df8e187.idunham@lavabit.com \
    --to=idunham@lavabit.com \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).