FS#10728 - netfilter*.h from kernel-headers are broken

Attached to Project: Arch Linux
Opened by Denis Martinez (denis) - Sunday, 22 June 2008, 16:50 GMT
Last edited by Andreas Radke (AndyRTR) - Saturday, 16 August 2008, 15:02 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Jan de Groot (JGC)
Andreas Radke (AndyRTR)
Architecture All
Severity Medium
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

It is impossible to compile code which depends on the netfilter headers (libnetfilter_queue, moblock from AUR), because apparently some type definitions were stripped from the original linux headers.

Test case:
#include <linux/netfilter.h>
int main() {}

which gives:
/usr/include/linux/netfilter.h:40: error: expected specifier-qualifier-list before ‘__u32’

link:
http://lkml.org/lkml/2008/5/20/446

Temporary solution:

I was able to compile by commenting out blocks of code from netfilter.h and netfilter_ipv4.h.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Saturday, 16 August 2008, 15:02 GMT
Reason for closing:  Not a bug
Comment by Filip Wojciechowski (fwojciec) - Monday, 07 July 2008, 12:38 GMT
One of the packages mentioned in the original report (moblock) still doesn't compile due to netfilter headers error.
Comment by Greg (dolby) - Monday, 07 July 2008, 12:39 GMT
You are using the testing repo right? As JGC said kernel-headers is still in testing
Comment by Filip Wojciechowski (fwojciec) - Monday, 07 July 2008, 13:09 GMT
Yes, I'm using testing.

Here is the moblock compile error for reference:

gcc -Wall -O2 -march=i586 -mtune=i686 -fomit-frame-pointer -ffast-math -D_GNU_SOURCE -DNFQUEUE -L/usr/include/libipq -c -o MoBlock.o MoBlock.c
In file included from /usr/include/linux/netfilter_ipv4.h:8,
from MoBlock.c:35:
/usr/include/linux/netfilter.h:40: error: expected specifier-qualifier-list before ‘__u32’
In file included from MoBlock.c:35:
/usr/include/linux/netfilter_ipv4.h:53: error: ‘INT_MIN’ undeclared here (not in a function)
/usr/include/linux/netfilter_ipv4.h:63: error: ‘INT_MAX’ undeclared here (not in a function)
make: *** [MoBlock.o] Error 1
Comment by Filip Wojciechowski (fwojciec) - Monday, 07 July 2008, 13:16 GMT
Ooops, sorry, disregard the previous comment -- I copied the error message from a comment on AUR, but it looks slightly different than the error I'm getting on my machine. The actual error, using the kernel-headers package from testing, is this:

gcc -Wall -O2 -march=i586 -mtune=i686 -fomit-frame-pointer -ffast-math -D_GNU_SOURCE -DNFQUEUE -L/usr/include/libipq -c -o MoBlock.o MoBlock.c
In file included from MoBlock.c:35:
/usr/include/linux/netfilter_ipv4.h:53: error: ?INT_MIN? undeclared here (not in a function)
/usr/include/linux/netfilter_ipv4.h:63: error: ?INT_MAX? undeclared here (not in a function)
make: *** [MoBlock.o] Error 1
Comment by bug (mrbug) - Saturday, 19 July 2008, 00:27 GMT
This is what I'm getting when trying to compile moblock... It may show something useful.

libnetfilter_queue.c:437: error: conflicting types for 'nfq_get_physindev_name'
../include/libnetfilter_queue/libnetfilter_queue.h:89: error: previous declaration of 'nfq_get_physindev_name' was here
libnetfilter_queue.c:445: warning: 'struct nlif_handle' declared inside parameter list
libnetfilter_queue.c:444: error: conflicting types for 'nfq_get_outdev_name'
../include/libnetfilter_queue/libnetfilter_queue.h:91: error: previous declaration of 'nfq_get_outdev_name' was here
libnetfilter_queue.c:452: warning: 'struct nlif_handle' declared inside parameter list
libnetfilter_queue.c:451: error: conflicting types for 'nfq_get_physoutdev_name'
../include/libnetfilter_queue/libnetfilter_queue.h:93: error: previous declaration of 'nfq_get_physoutdev_name' was here
make[1]: *** [libnetfilter_queue.lo] Error 1
make[1]: Leaving directory `/libnetfilter_queue/src/libnetfilter_queue-0.0.16/src'
make: *** [all-recursive] Error 1
Comment by Jan de Groot (JGC) - Saturday, 19 July 2008, 09:32 GMT
That's a bug in the package itself, not in the kernel-headers package.
Comment by Filip Wojciechowski (fwojciec) - Saturday, 19 July 2008, 16:19 GMT
I don't get the libnetfilter_queue problem -- it compiles without any issue on my system.
Comment by Filip Wojciechowski (fwojciec) - Monday, 21 July 2008, 11:49 GMT
Even thought libnetfilter_queue seems to work, at least for me, moblock still does not compile. I am able to compile moblock using a different distro (same kernel, gcc 4.2.4). I have reported a bug on the moblock (http://developer.berlios.de/bugs/?func=detailbug&bug_id=14144&group_id=2509) but the developer believes that this is not a problem with the application.
Comment by Filip Wojciechowski (fwojciec) - Friday, 15 August 2008, 19:36 GMT
I think I've found a fix for the moblock compile error (see http://bbs.archlinux.org/viewtopic.php?id=53533), so if the moblock issue was the only thing left to resolve here I think this bug report can be closed.

Loading...