From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11173 Path: news.gmane.org!.POSTED!not-for-mail From: Ralph Sennhauser Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH 1/1] make net/if.h suppress clashing definitions from kernel headers Date: Mon, 20 Mar 2017 06:41:42 +0100 Message-ID: <20170320054142.31554-1-ralph.sennhauser@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1490009766 14011 195.159.176.226 (20 Mar 2017 11:36:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Mar 2017 11:36:06 +0000 (UTC) Cc: Ralph Sennhauser To: musl@lists.openwall.com Original-X-From: musl-return-11188-gllmg-musl=m.gmane.org@lists.openwall.com Mon Mar 20 12:36:02 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1cpvbK-0002BT-Tr for gllmg-musl@m.gmane.org; Mon, 20 Mar 2017 12:35:51 +0100 Original-Received: (qmail 16102 invoked by uid 550); 20 Mar 2017 11:35:53 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 1942 invoked from network); 20 Mar 2017 05:42:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=vozMiZ+ip12+COt3Ab8aQiWMhv+07ABuuemWEFtGIUs=; b=P6kn7/NAvCyB1koNZalM1ocOrr5q1ADLuS/ahfgGz6IKjZvfWChDNQOeLYfC5plEKq PGzsPMXdbk7+tmhyVqCi1jOJ6D2OeWme5TFTOxLMXQ+4lhRYKfd/+7plko4/U4/HCC2f GmTRQHPCS1z2slnWFHlnTPB9Ln+olJ52LJ/OBKKHCpMSMqyLKbt2Xsmdmz227VlOYN+6 FX+JvDB3ARh8Rgn0fvICd+bl5EasCnCDfnvIx1snY9nognJC5Ply4vX+YGgq6S+0rqD9 FOUgpnisq2ZrZkiU7iGMLnFFKzCVji4iPjk5oEyB0PoRVUE5BOdVBsIaYKJ9njc3m3Jc ZVbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vozMiZ+ip12+COt3Ab8aQiWMhv+07ABuuemWEFtGIUs=; b=EzEITq0OhFUAm+ArbNm2itaZ6pYNItoz4vH2hU37kb4tTYGrctBpcdmfsg1ueubu3Q Cu0r+M4rEPKBXFOFUCN93XEMaibkRI6VwXGcGaUFBImjCTDqZV7m85e2SfwoOebX8JBo blRAat20HRC0f8HvMPXGn8GNaPjElNnyXcJd3iH6v/KhYo2lqa6HQXouBePPVeFjd4xQ /3c1FCj/HC93m5L59GasKWnrFgf3ehMJoCsI8CgggsXQzZMCzBHT36cmwiT8eRY+vEC6 LNk28+4Lx4U7G8P573GhsDSVxldnRbhFCkO3j81As71fXntk5ZC0OV9VcWGPu1ftasNL t/wA== X-Gm-Message-State: AFeK/H30IvvdiopqwUTprD2l7docZOLSLYqJPRpo5UfXd+bFfo9DdNorgnCY4lKNx5rfdQ== X-Received: by 10.223.136.213 with SMTP id g21mr23509338wrg.189.1489988511215; Sun, 19 Mar 2017 22:41:51 -0700 (PDT) X-Mailer: git-send-email 2.10.2 Xref: news.gmane.org gmane.linux.lib.musl.general:11173 Archived-At: The linux kernel uapi headers provide their own definitions of the structures from net/if.h, resulting in errors when a program includes both the standard libc header and one or more of the networking-related kernel headers that pull in the kernel definitions. As was done for netinet/in.h in 04983f227238 ("make netinet/in.h suppress clashing definitions from kernel headers"), do not attempt to support the case where kernel headers are included before the libc ones, since the kernel definitions may have subtly incorrect types, namespace violations, etc. However, support the inclusion of the kernel headers after the libc ones, since the kernel headers provide a public interface for suppressing their definitions. This patch adds the necessary macro definitions for such suppression. Signed-off-by: Ralph Sennhauser --- Hi everyone, Just like commit 04983f227238 ("make netinet/in.h suppress clashing definitions from kernel headers") this patch needs changes to to the kernels libc-compat.h. The required patch to make this work was submitted by Felix Janda [1], but inclusion got apparently stalled. Commit 04983f227238, this one and the one for the kernel allow to build a large portion of packages to be built without modifications against Musl libc. [1] https://lkml.org/lkml/2016/11/11/210 Ralph PS: I'm not subscribed, so please keep my CC --- include/net/if.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/net/if.h b/include/net/if.h index 2f2fcc1..3e7587a 100644 --- a/include/net/if.h +++ b/include/net/if.h @@ -125,6 +125,12 @@ struct ifconf { #define ifc_req ifc_ifcu.ifcu_req #define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0) +#define __UAPI_DEF_IF_IFCONF 0 +#define __UAPI_DEF_IF_IFMAP 0 +#define __UAPI_DEF_IFREQ 0 +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0 +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 + #endif #ifdef __cplusplus -- 2.10.2