Skip to contentSkip to conversation

Unable to build iptables on linux kernel 2.6.10 + 2.6.11-rc2 + 2.6.11-rc2-bk5

DISCUSSION Applied Colin Harrison 5 participants 7 messages Jan 27, 2005 – Feb 1, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

Hi
I am experimenting with the linux kernel 2.6.10 + 2.6.11-rc2 + 2.6.11-rc2-bk5.
When I try to build CVS snapshot iptables (iptables-1.3.0-20050125) against this kernel I get:-

make KERNEL_DIR=/home/src/kernel/linux-2.6.10
....
cc -O2 -Wall -Wunused -I/home/src/kernel/linux-2.6.10/include -Iinclude/ -DIPTABLES_VERSION=\"1.3.0-20050125\" -fPIC -o extensions/libipt_conntrack_sh.o -c extensions/libipt_conntrack.c In file included from extensions/libipt_conntrack.c:13:
/home/src/kernel/linux-2.6.10/include/linux/netfilter_ipv4/ip_conntrack_tupl e.h:67: error: parse error before "u8" /home/src/kernel/linux-2.6.10/include/linux/netfilter_ipv4/ip_conntrack_tupl e.h:67: warning: no semicolon at end of struct or union /home/src/kernel/linux-2.6.10/include/linux/netfilter_ipv4/ip_conntrack_tupl e.h:67: warning: no semicolon at end of struct or union /home/src/kernel/linux-2.6.10/include/linux/netfilter_ipv4/ip_conntrack_tupl e.h:70: warning: type defaults to int' in declaration of dir'
...

The kernel appears to be patched with all the latest conntrack changes and compiles cleanly.

More info. can be supplied, as required.

Thanks

Colin Harrison

#1 lore raw
Quoted 7 lines · Colin Harrison

Hi
I am experimenting with the linux kernel 2.6.10 + 2.6.11-rc2 + 2.6.11-rc2-bk5.
When I try to build CVS snapshot iptables (iptables-1.3.0-20050125) against this kernel I get:-

Quoted 10 lines

make KERNEL_DIR=/home/src/kernel/linux-2.6.10
....
cc -O2 -Wall -Wunused -I/home/src/kernel/linux-2.6.10/include -Iinclude/ -DIPTABLES_VERSION=\"1.3.0-20050125\" -fPIC -o extensions/libipt_conntrack_sh.o -c extensions/libipt_conntrack.c In file included from extensions/libipt_conntrack.c:13:
/home/src/kernel/linux-2.6.10/include/linux/netfilter_ipv4/ip_conntrack_tupl e.h:67: error: parse error before "u8"

u8 seems not to be defined in user space, that's why iptables complains in compilation time. A quick grep at /usr/include on my laptop tells me that such definition doesn't exist in user space. AFAICS it's only defined in kernel space. So, I've renamed it to u_int8_t and that fixed the problem.

Patrick, if this is the best way to fix this problem, are you willing to add it to your patchset?

--
Pablo

===== include/linux/netfilter_ipv4/ip_conntrack_tuple.h 1.6 vs edited =====

include/linux/netfilter_ipv4/ip_conntrack_tuple.h +2 -2
@@ -64,10 +64,10 @@
 		} u;
 
 		/* The protocol. */
-		u8 protonum;
+		u_int8_t protonum;
 
 		/* The direction (for tuplehash) */
-		u8 dir;
+		u_int8_t dir;
 	} dst;
 };
 
#2 lore raw

include/linux/netfilter_ipv4/ip_conntrack_tuple.h line 70

Quoted 7 lines
include/linux/netfilter_ipv4/ip_conntrack_tuple.h +2 -2
 		/* The protocol. */
-		u8 protonum;
+		u_int8_t protonum;
 
 		/* The direction (for tuplehash) */
-		u8 dir;
+		u_int8_t dir;

I think __u8 would be a better choice.

#3 lore raw
Quoted 4 lines · Thomas Graf
Quoted 4 lines
		/* The protocol. */
include/linux/netfilter_ipv4/ip_conntrack_tuple.h +1 -1
-		u8 protonum;
+		u_int8_t protonum;
Quoted 9 lines

include/linux/netfilter_ipv4/ip_conntrack_tuple.h line 70

Quoted 5 lines
		/* The direction (for tuplehash) */
include/linux/netfilter_ipv4/ip_conntrack_tuple.h +1 -1
-		u8 dir;
+		u_int8_t dir;

I think __u8 would be a better choice.

I don't think so. With __u8 iptables doesn't compile anymore on my laptop.

cc -O2 -Wall -Wunused -I/home/pablo/bk/linux-2.5/include -Iinclude/ -DIPTABLES_VERSION=\"1.3.0\" -fPIC -o extensions/libipt_conntrack_sh.o -c extensions/libipt_conntrack.c In file included from extensions/libipt_conntrack.c:13:
/home/pablo/bk/linux-2.5/include/linux/netfilter_ipv4/ip_conntrack_tuple.h:67: parse error before `__u8' /home/pablo/bk/linux-2.5/include/linux/netfilter_ipv4/ip_conntrack_tuple.h:67: warning: no semicolon at end of struct or union
...

--
Pablo

#4 lore raw
In reply to Thomas Graf

Whats the exact difference between each of the possibilities?

Quoted 16 lines · Thomas Graf

include/linux/netfilter_ipv4/ip_conntrack_tuple.h line 70

Quoted 7 lines
include/linux/netfilter_ipv4/ip_conntrack_tuple.h +2 -2
 		/* The protocol. */
-		u8 protonum;
+		u_int8_t protonum;
 
 		/* The direction (for tuplehash) */
-		u8 dir;
+		u_int8_t dir;

I think __u8 would be a better choice.

#5 lore raw
In reply to Thomas Graf
Quoted 11 lines · Thomas Graf

include/linux/netfilter_ipv4/ip_conntrack_tuple.h line 70

Quoted 8 lines
		/* The protocol. */
include/linux/netfilter_ipv4/ip_conntrack_tuple.h +1 -1
-		u8 protonum;
+		u_int8_t protonum;
		/* The direction (for tuplehash) */
include/linux/netfilter_ipv4/ip_conntrack_tuple.h +1 -1
-		u8 dir;
+		u_int8_t dir;

I think __u8 would be a better choice.

Usually yes, but all netfilter headers use u_intX_t.

#6 lore raw
In reply to Pablo Neira
Quoted 3 lines · Pablo Neira

u8 seems not to be defined in user space, that's why iptables complains in compilation time. A quick grep at /usr/include on my laptop tells me that such definition doesn't exist in user space. AFAICS it's only defined in kernel space. So, I've renamed it to u_int8_t and that fixed the problem.

Patrick, if this is the best way to fix this problem, are you willing to add it to your patchset?

It's the easiest way :)

Applied, thanks.