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] [day] [month] [year] [list]
Date:	Tue, 05 Jan 2010 02:32:23 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Matthew Burgess <matthew@...uxfromscratch.org>
Cc:	netdev@...r.kernel.org, davem@...emloft.net,
	linux-kernel@...r.kernel.org
Subject: Re: Compilation issues using netlink.h

On Mon, 2009-12-28 at 00:32 +0000, Matthew Burgess wrote:
> Hi,
> 
> The test case below simplifies a failure I see when trying to compile 
> strace using kernel headers from Linux-2.6.32.2:
> 
> #include <linux/netlink.h>
> struct sockaddr_nl nl;
> int main() {
>    return 0;
> }
> 
> $ gcc -o test test.c
> In file included from test.c:1:
> /usr/include/linux/netlink.h:34: error: expected 
> specifier-qualifier-list before 'sa_family_t'
> 
> The comment in netlink.h suggests that 'sa_family_t' is expected to be 
> found in linux/socket.h, but since commit 9c501935a3 ("net: Support 
> inclusion of <linux/socket.h> before <sys/socket.h>") that appears to 
> not be true anymore, it's now in sys/socket.h.

Right.  I'm aware of this and suggested that it should be reverted, but
David Miller reckons I was right in the first place.

> Sure enough, if I change 
> the include in netlink.h to pull in sys/socket.h instead of 
> linux/socket.h, that enables the test case (and strace) to compile 
> again, but I wasn't sure if it was really the right thing to do.

I don't think it is - that will bring in many more definitions.

There are actually a whole lot of kernel networking headers which
require sa_family_t when included by user-space code.  Until
<linux/socket.h> and <sys/socket.h> cooperate to define sa_family_t
once, you will just have to include <sys/socket.h> before kernel
networking headers.

Ben.

-- 
Ben Hutchings
The obvious mathematical breakthrough [to break modern encryption] would be
development of an easy way to factor large prime numbers. - Bill Gates

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ