lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061206134308.GL9556@sunsite.mff.cuni.cz>
Date:	Wed, 6 Dec 2006 14:43:08 +0100
From:	Jakub Jelinek <jakub@...hat.com>
To:	Ulrich Drepper <drepper@...hat.com>,
	David Woodhouse <dwmw2@...radead.org>
Cc:	Thomas Graf <tgraf@...g.ch>,
	"Joseph S. Myers" <joseph@...esourcery.com>,
	netdev@...r.kernel.org, libc-alpha@...rceware.org, akpm@...l.org,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: Kernel header changes break glibc build

On Wed, Dec 06, 2006 at 01:01:54PM +0000, David Woodhouse wrote:
> No. They _are_ doing it right -- they're running 'make headers_install'
> against the 2.6.19 kernel and only _now_ are they finding that we broke
> it without even the courtesy of a warning, let alone any consultation.
> 
> If _we_ had done it right, then they would have been warned when we
> decided to change this, and we wouldn't have just released 2.6.19 with
> changes which break the glibc build.

Yeah, I don't think glibc was doing anything wrong and the 2.6.19
changes to the make headers_install created headers mean we'd
either need to add configure checks for the headers (we can't
simply #include <linux/if_addr.h> because that header didn't
exist pre 2.6.19 and IF*_{RTA,PAYLOAD} macros were dropped anyway),
or we need to start defining this ourselves.

Here is the second variant.
I just hope further kernel header "cleanups" don't cause similar
breakage though.

2006-12-06  Jakub Jelinek  <jakub@...hat.com>

	* sysdeps/unix/sysv/linux/netlinkaccess.h (struct ifaddrmsg): New type.
	(IFA_UNSPEC, IFA_ADDRESS, IFA_LOCAL, IFA_LABEL, IFA_BROADCAST,
	IFA_ANYCAST, IFA_CACHEINFO, IFA_MULTICAST): New enum.
	(IFA_F_SECONDARY, IFA_F_TEMPORARY, IFA_F_HOMEADDRESS,
	IFA_F_DEPRECATED): Define if not defined.
	(IFA_RTA, IFA_PAYLOAD, IFLA_RTA, IFLA_PAYLOAD): Likewise.
	* sysdeps/unix/sysv/linux/check_pf.c: Include netlinkaccess.h
	instead of asm/types.h, linux/netlink.h and linux/rtnetlink.h.

--- libc/sysdeps/unix/sysv/linux/netlinkaccess.h.jj	2006-01-08 09:21:15.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/netlinkaccess.h	2006-12-06 13:48:50.000000000 +0100
@@ -25,6 +25,51 @@
 
 #include <kernel-features.h>
 
+/* 2.6.19 kernel headers helpfully removed some macros and
+   moved lots of stuff into new headers, some of which aren't
+   included by linux/rtnetlink.h.  */
+
+#ifndef IFA_MAX
+struct ifaddrmsg
+{
+  uint8_t ifa_family;
+  uint8_t ifa_prefixlen;
+  uint8_t ifa_flags;
+  uint8_t ifa_scope;
+  uint32_t ifa_index;
+};
+
+enum
+{
+  IFA_UNSPEC,
+  IFA_ADDRESS,
+  IFA_LOCAL,
+  IFA_LABEL,
+  IFA_BROADCAST,
+  IFA_ANYCAST,
+  IFA_CACHEINFO,
+  IFA_MULTICAST
+};
+#endif
+
+#ifndef IFA_F_SECONDARY
+# define IFA_F_SECONDARY	0x01
+# define IFA_F_TEMPORARY	IFA_F_SECONDARY
+# define IFA_F_HOMEADDRESS	0x10
+# define IFA_F_DEPRECATED	0x20
+#endif
+
+#ifndef IFA_RTA
+# define IFA_RTA(r) \
+  ((struct rtattr *) ((char *)(r) + NLMSG_ALIGN (sizeof (struct ifaddrmsg))))
+# define IFA_PAYLOAD(n) NLMSG_PAYLOAD (n, sizeof (struct ifaddrmsg))
+#endif
+
+#ifndef IFLA_RTA
+# define IFLA_RTA(r) \
+  ((struct rtattr *) ((char *)(r) + NLMSG_ALIGN (sizeof (struct ifinfomsg))))
+# define IFLA_PAYLOAD(n) NLMSG_PAYLOAD (n, sizeof (struct ifinfomsg))
+#endif
 
 struct netlink_res
 {
--- libc/sysdeps/unix/sysv/linux/check_pf.c.jj	2006-09-24 18:50:22.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/check_pf.c	2006-12-06 13:54:37.000000000 +0100
@@ -27,13 +27,10 @@
 #include <unistd.h>
 #include <sys/socket.h>
 
-#include <asm/types.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-
 #include <not-cancel.h>
 #include <kernel-features.h>
 
+#include "netlinkaccess.h"
 
 #ifndef IFA_F_TEMPORARY
 # define IFA_F_TEMPORARY IFA_F_SECONDARY


	Jakub
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ