From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2066 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Clash between 'netinet/if_ether.h' and 'linux/if_ether.h' Date: Tue, 9 Oct 2012 19:15:53 -0400 Message-ID: <20121009231553.GQ254@brightrain.aerifal.cx> References: <5073577D.5010000@embtoolkit.org> <20121008233307.GP254@brightrain.aerifal.cx> <20121009161343.7ce4fa5f.idunham@lavabit.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1349825081 721 80.91.229.3 (9 Oct 2012 23:24:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Oct 2012 23:24:41 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2067-gllmg-musl=m.gmane.org@lists.openwall.com Wed Oct 10 01:24:48 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TLjAJ-0005mL-02 for gllmg-musl@plane.gmane.org; Wed, 10 Oct 2012 01:24:43 +0200 Original-Received: (qmail 32138 invoked by uid 550); 9 Oct 2012 23:24:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32126 invoked from network); 9 Oct 2012 23:24:36 -0000 Content-Disposition: inline In-Reply-To: <20121009161343.7ce4fa5f.idunham@lavabit.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2066 Archived-At: 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 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 is included first? 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. Rich