Skip to contentSkip to conversation

32 vs 64 bits

DISCUSSION Nicolas Dichtel 2 participants 2 messages Mar 26, 2009 netfilter

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm trying to understand why the following commit has been done:

http://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commitdiff;h=7d5cc229064b0e718046b9ecaebad3426dfff15f

Removes KERNEL_64_USERSPACE_32

Yasuyuki KOZAKAI [Sat, 30 Jun 2007 10:47:57 +0000 (10:47 +0000)]

The recent kernel has compat layer for iptables. It doesn't have compat layer for libipq and ip6tables, but ip6tables with KERNEL_64_USERSPACE_32 is still broken. We should fix kernel instead of fixing them if and when we want use their 32bit binary with 64bit kernel.

Where is the compat layer? If I look in a recent kernel, it seems that ip_queue.h still uses long and is broken.
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=blob;f=include/linux/netfilter_ipv4/ip_queue.h;hb=59b8bfd8fd608821e5addc9f4682c7f2424afd8c

Am I wrong?
If yes, what is the right way to fix this? Updating the API?

Thank you,
Nicolas

#1 lore raw
Quoted 8 lines · Nicolas Dichtel

Hi all,

I'm trying to understand why the following commit has been done:

http://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commitdiff;h=7d5cc229064b0e718046b9ecaebad3426dfff15f

Removes KERNEL_64_USERSPACE_32

Quoted 8 lines

Yasuyuki KOZAKAI [Sat, 30 Jun 2007 10:47:57 +0000 (10:47 +0000)]

The recent kernel has compat layer for iptables. It doesn't have compat layer for libipq and ip6tables, but ip6tables with KERNEL_64_USERSPACE_32 is still broken. We should fix kernel instead of fixing them if and when we want use their 32bit binary with 64bit kernel.

Where is the compat layer?

For example, net/netfilter/xt_MARK.c there are some regions with "#ifdef CONFIG_COMPAT". People used to use the C type "long", which has different sizes across different platforms, leading to a mess and evidently the compat conversion functions. Many of the Xtables modules do not suffer from this and hence there is not that much compat code left.

Quoted 3 lines

If I look in a recent kernel, it seems that
ip_queue.h still uses long and is broken.
[linux/netfilter_ipv4/ip_queue.h]

Indeed this seems so.

Quoted 2 lines

Am I wrong?
If yes, what is the right way to fix this? Updating the API?

Use libnetfilter_queue ;-)