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: <47BAE13D.4060206@trash.net>
Date:	Tue, 19 Feb 2008 15:01:33 +0100
From:	Patrick McHardy <kaber@...sh.net>
To:	David Woodhouse <dwmw2@...radead.org>
CC:	netdev@...r.kernel.org, Jan Engelhardt <jengelh@...putergmbh.de>,
	"David S. Miller" <davem@...emloft.net>, varevoka@...hat.com
Subject: Re: [NETFILTER]: Introduce nf_inet_address

David Woodhouse wrote:
>> +union nf_inet_addr {
>> +	u_int32_t	all[4];
>> +	__be32		ip;
>> +	__be32		ip6[4];
>> +};
>> +
>>  #ifdef __KERNEL__
>>  #ifdef CONFIG_NETFILTER
> 
> This breaks the busybox build:
> 
> CC      ipsvd/tcpudp.o
> In file included from /usr/include/linux/netfilter_ipv4.h:8,
>                  from ipsvd/tcpudp.c:33:
> /usr/include/linux/netfilter.h:40: error: expected specifier-qualifier-list before 'u_int32_t'
> 
> What is this 'u_int32_t' nonsense anyway?
> 
> If a user-visible header is likely to be included by libc directly from
> a 'standard' header, it may not require <stdint.h>. Therefore it should
> use the system-specific types such as '__u32'.

Right, I queued this patch to fix it.

> If it isn't likely to be included by libc, which is the case for
> netfilter, then it might as well just use the proper C types. Those who
> are stuck on C89 or earlier might still prefer to use '__u32' even when
> there's no need for it, but 'u_int32_t' is just silly. I suspect we
> should eradicate it.

Yes, some more consitency would be nice. So far the consensus was
to not use it in new code, but keep using it in subsystems like
netfilter that (almost) consistently use it everywhere.

> I couldn't make busybox work with it --
> __BIT_TYPES_DEFINED__ is defined in <sys/types.h> and prevents the
> definitions of u_int32_t et al from appearing in <linux/types.h>. And if
> I include <linux/types.h> first, other things break.
> 
> A later commit adds struct in_addr and struct in6_addr to this union
> too, which breaks busybox even harder.

Thats odd, the iptables headers have always used struct in_addr and
struct in6_addr in struct ipt_ip/struct ip6t_ip6, which are also
used by userspace. What is "ipsvd/tcpudp.c"? I couldn't find it in
the Debian busybox source.

> How is this supposed to be used in userspace? Or is it even supposed to
> be exposed?

Yes, its meant to replace many self-made "AF-independant" address
representations.

View attachment "x" of type "text/plain" (710 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ