Skip to contentSkip to conversation

iptables 1.3.6 compilation issues in libipt_iprange.c (non-existant __be32 type)

PATCH Steven Van Acker 3 participants 4 messages Dec 4, 2006 netfilter

lore
Share & tools
lore
#0 lore raw

Hi,

iptables 1.3.6 does not compile with the 2.6.19 kernel because an undefined type __be32 is used in libipt_iprange.c

Apparently, a fix was issued before, which can be found here:
http://lists.netfilter.org/pipermail/netfilter/2006-October/066954.html

Before I started looking for a patch, I wrote one myself and it's a bit different from the one found at the location mentioned above.

Instead of #defining the __be32 type "manually", you could also #include <linux/types.h>, which defines that datatype.

I'm not sure if it's a good idea to duplicate definitions of datatypes in iptables. Is there a purpose I'm overlooking ?

Is it also possible to mention the fix for the __be32 issue on netfilter.org ? I'm sure more people will run into it as 2.6.19 is going mainstream, and we don't all use the SVN repository to compile iptables :)

kind regards,
-- Steven
PS: my one-line patch is attached for reference

Signature · 2 lines
My amazon wishlist:
http://www.amazon.com/gp/registry/1DB4XNEIEQBPB
extensions/libipt_iprange.c +1 -0
diff -Naur iptables-1.3.6/extensions/libipt_iprange.c iptables-1.3.6-patched/extensions/libipt_iprange.c
@@ -6,6 +6,7 @@
 #include <getopt.h>
 
 #include <iptables.h>
+#include <linux/types.h>
 #include <linux/netfilter_ipv4/ipt_iprange.h>
 
 /* Function which prints out usage message. */
#1 lore raw
Quoted 15 lines · Steven Van Acker

Hi,

iptables 1.3.6 does not compile with the 2.6.19 kernel because an undefined type __be32 is used in libipt_iprange.c

Apparently, a fix was issued before, which can be found here:
http://lists.netfilter.org/pipermail/netfilter/2006-October/066954.html

Before I started looking for a patch, I wrote one myself and it's a bit different from the one found at the location mentioned above.

Instead of #defining the __be32 type "manually", you could also #include <linux/types.h>, which defines that datatype.

Quoted 7 lines

I'm not sure if it's a good idea to duplicate definitions of datatypes in iptables. Is there a purpose I'm overlooking ?

Is it also possible to mention the fix for the __be32 issue on netfilter.org ? I'm sure more people will run into it as 2.6.19 is going mainstream, and we don't all use the SVN repository to compile iptables :)

I've already uploaded a 1.3.7 release to ftp.netfilter.org to fix this issue (please test :), once the webpage has been updated I'll send out the announcement.

#2 lore raw
Quoted 3 lines · Patrick McHardy

I've already uploaded a 1.3.7 release to ftp.netfilter.org to fix this issue (please test :), once the webpage has been updated I'll send out the announcement.

1.3.7 compiles and works nicely with a 2.6.19 kernel on my system. Thanks :)

I'm still wondering why <linux/types.h> is not used though. Is it to avoid complications with older kernels ?

kinds regards,
-- Steven

Signature · 2 lines
My amazon wishlist:
http://www.amazon.com/gp/registry/1DB4XNEIEQBPB
#3 lore raw
Quoted 5 lines · Steven Van Acker

1.3.7 compiles and works nicely with a 2.6.19 kernel on my system. Thanks :)

I'm still wondering why <linux/types.h> is not used though. Is it to avoid complications with older kernels ?

Main reason is because I didn't think of it :) But I don't see an advantage in changing it again.