Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 20 Mar 2017 06:41:42 +0100
From: Ralph Sennhauser <ralph.sennhauser@...il.com>
To: musl@...ts.openwall.com
Cc: Ralph Sennhauser <ralph.sennhauser@...il.com>
Subject: [PATCH 1/1] make net/if.h suppress clashing definitions from kernel headers

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 <ralph.sennhauser@...il.com>
---

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

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ