Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 53537 - header problem with iptables
Summary: header problem with iptables
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 All
: High major
Assignee: x86-kernel@gentoo.org (DEPRECATED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-10 09:09 UTC by Travis Tilley (RETIRED)
Modified: 2004-07-01 06:10 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Changes iptables to use llh headers instead of linux kernel headers (07_all_llh.patch.bz2,421 bytes, patch)
2004-06-14 10:14 UTC, Blu3
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Travis Tilley (RETIRED) gentoo-dev 2004-06-10 09:09:50 UTC
iptables is refusing to compile with linux-headers 2.6.6 and gcc 3.4.

gcc -O2 -march=athlon64 -g3 -pipe -Iinclude -Wall -Wunused -I/usr/src/linux/include  -DIPTABLES_VERSION=\"1.2.9\"  -fPIC -o extensions/libipt_stealth_sh.o -c extensions/libipt_stealth.c
In file included from include/libiptc/libiptc.h:6,
                 from include/iptables.h:5,
                 from extensions/libipt_stealth.c:10:
/usr/src/linux/include/linux/netfilter_ipv4/ip_tables.h:255: warning: no semicolon at end of struct or union
/usr/src/linux/include/linux/netfilter_ipv4/ip_tables.h:255: error: parse error before '*' token
/usr/src/linux/include/linux/netfilter_ipv4/ip_tables.h:259: error: parse error before '}' token
/usr/src/linux/include/linux/netfilter_ipv4/ip_tables.h:339: warning: type defaults to `int' in declaration of `DECLARE_MUTEX'
/usr/src/linux/include/linux/netfilter_ipv4/ip_tables.h:339: warning: parameter names (without types) in function declaration
/usr/src/linux/include/linux/netfilter_ipv4/ip_tables.h:339: warning: 'DECLARE_MUTEX' declared `static' but never defined
make: *** [extensions/libipt_stealth_sh.o] Error 1

!!! ERROR: net-firewall/iptables-1.2.9-r1 failed.
!!! Function src_compile, Line 66, Exitcode 2
!!! (no error message)
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2004-06-10 09:14:46 UTC
<Lv> not yet, just re-assign it to me.... i have to figure out why it wont merge in stable but will in testing
Comment 2 Travis Tilley (RETIRED) gentoo-dev 2004-06-10 13:39:42 UTC
i am a dumbass. i was using the 2.6.7-rc3 sources on my stable partition, but 2.6.7-rc2-mm2 on my testing partition.

out of curiousity... why does iptables use /usr/src/linux and not linux-headers?
Comment 3 Travis Tilley (RETIRED) gentoo-dev 2004-06-10 13:41:55 UTC
re-assigning to plasmaroo ^_^
*hides from pillow*
Comment 4 Travis Tilley (RETIRED) gentoo-dev 2004-06-10 14:11:24 UTC
re-assigning to aliz at plasmaroo's suggestion.

aliz - why doesnt iptables use the system headers? it seems like it would be more controllable that way, and the headers could be patched to allow iptables to always include the same extensions (grsec stuff?)
Comment 5 Blu3 2004-06-14 08:58:57 UTC
I've put a word in to Mariusz Mazur <mmazurXkernel.pl>, the maintainer of linux-headers package for 2.6.  He replied to me and I've asked him to take a gander at it.
Comment 6 Blu3 2004-06-14 09:31:49 UTC
On poniedzia&#322;ek, 14 czerwca 2004 17:56, David Ford wrote:

>> To compile iptables 1.2.9.  It seems that __user and DECLARE_MUTEX are
>> missing.


Please apply 
http://ep09.pld-linux.org/~mmazur/linux-libc-headers/patches/iptables.patch
That patch will make iptables build against llh, not kernel headers.


Comment 7 Blu3 2004-06-14 10:14:00 UTC
Created attachment 33236 [details, diff]
Changes iptables to use llh headers instead of linux kernel headers

1. add to files/1.2.9-files/
2. bump to 1.2.9-r2
3. ebuild .. digest
4. emerge -u
5. admins rejoice
Comment 8 Travis Tilley (RETIRED) gentoo-dev 2004-06-14 11:03:44 UTC
aliz was last seen 4 weeks, 5 days, 4 hours, 9 minutes and 57 seconds ago. re-assigning to bug-wranglers so that they can figure out where this goes...
Comment 9 Daniel Ahlberg (RETIRED) gentoo-dev 2004-06-14 11:53:35 UTC
I think the reason iptables builds against the linux sources is becuse it's easier to patch for the extensions that are applied to the iptables source. On one hand it's a good idea to have iptables built against "static" headers that are "under control". But on the other hand when new extensions are added iptables would have to depend on a new version of the linux headers that aren't updated/unmasked as frequent as iptables.

So it all comes down to the extensions...

I'm open for suggestions and ideas.
Comment 10 Blu3 2004-06-14 13:12:50 UTC
The maintainer of linux-headers for 2.6.x seems to be doing a pretty decent job of releasing often.  I have to side with the LKML guys on this, userland applications should be using userland includes.  If the headers are broken in this regard, then the headers should be fixed.  Things change in /usr/src/linux far too much and that means a constant catch-up game.  However, when things change that affect userland, then the changes should be propogated by the linux-headers package maintainer.

As time progresses, the header mess that is exported from linux-source will get cleaned up naturally and extension oddities will become less frequent.
Comment 11 Travis Tilley (RETIRED) gentoo-dev 2004-06-14 20:41:11 UTC
re-adding plasmaroo ^_^

plasmaroo - are you game for patching linux-headers for the extensions iptables supports, or should we just leave as is? what's your opinion? it should, perhaps, use an ALT_HEADERS variable like the new glibc... that way there is one default location for headers (/usr/include) that you can overwrite simply by setting an environment variable.
Comment 12 Travis Tilley (RETIRED) gentoo-dev 2004-06-15 13:29:20 UTC
talked to plasmaroo on irc, he says drop it. dropping it.
Comment 13 Kalin KOZHUHAROV 2004-06-18 10:54:27 UTC
As bug 54067 goes, there is already 1.2.10 out, anybody making applying the patch and putting that into portage tree for easier tesing.

BTW, why is this marked as wontfix?
From the discussion, I couldn't quite figure out what exctly the bug was.. I t was "cannot compile iptables with 2.6.x kernel", right?
And the fix is to change ebuild to use linuh headers, right?
So then this should be resolved-fixed, or I am wrong?

And, Blu3, please don't add compressed patches here, or at least don't mark them as type "patch".
Comment 14 Travis Tilley (RETIRED) gentoo-dev 2004-06-22 04:03:04 UTC
well, this bug WAS that iptables doesnt use system headers... but it seems that iptables doesnt compile using 2.6.7 at all and needs to optionally use system headers anyways.
Comment 15 Wolfram Schlich (RETIRED) gentoo-dev 2004-06-22 07:46:42 UTC
iptables compiles fine on a 2.6.7-machine when you remove the /usr/src/linux symlink, so I guess it's just some INCDIR statement in the iptables sources...
Comment 16 Lourdes Jones 2004-06-23 11:46:28 UTC
For what it's worth, I'm using linux-headers 2.6.7 and iptables compiles without a problem when the /usr/src/linux symlink is removed but fails when the symlink points to my 2.6.7 kernel source files.

The difference seems to be in include/linux/netfilter_ipv4/ip_tables.h,
system headers have added the following lines which allow the compile.
---
#ifndef DECLARE_MUTEX
#  include <asm/semaphore.h>
#endif
#include <linux/compiler.h>
---
Comment 17 Travis Tilley (RETIRED) gentoo-dev 2004-06-28 11:38:54 UTC
<aliz> Lv: Regarding iptables being built against linux headers, Ive come up with a compromise. A new use flag that controls the applying of extension patches and building against the sources, otherwise iptables builds against the headers.

i think that means this bug can be closed :)
Comment 18 Alin Năstac (RETIRED) gentoo-dev 2004-06-28 12:07:51 UTC
I thing iptables compiles with /usr/src/linux because it is the only way to determine if a certain feature should be included at compile time or not. For example, if I don't select IMQ target in my kernel (CONFIG_IP_NF_TARGET_IMQ), libipt_IMQ.so will not be generated. 

Also, there are patches regarding iptables (patch-o-matic stuff) which modifies structures in kernel by appending new members to them, so you need to compile iptables with /usr/src/linux in order to work with your kernel, otherwise nasty things could happen.

If the kernel headers installed by gentoo are generated based on my .config, then you could ignore my comment; else, it is best to let iptables using /usr/src/linux.
Comment 19 Gus 2004-07-01 06:02:19 UTC
Travis. What's the new USE flag that will control this behaviour?

Gus
Comment 20 Alin Năstac (RETIRED) gentoo-dev 2004-07-01 06:10:12 UTC
the flag is called "extensions", as you can see if you launch "equery uses iptables" or "emerge -pv iptables"