Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: iptables: User

compiling extension modules with -std=c99 fails

 

 

iptables user RSS feed   Index | Next | Previous | View Threaded


sashang at gmail

Jul 30, 2007, 7:14 PM

Post #1 of 3 (1324 views)
Permalink
compiling extension modules with -std=c99 fails

Hi

Is there any reason why compiling the iptables extensions should fail
when using -std=c99?

cc -O2 -Wall -Wunused
-I/usr/src/kernels/2.6.18-1.2798.fc6-i586/include -Iinclude/
-DIPTABLES_VERSION=\"1.3.5\"
-DIPT_LIB_DIR=\"/usr/local/lib/iptables\" -rdynamic -o iptables
iptables-standalone.c iptables.o libiptc/libiptc.a -ldl -lnsl -std=c99
In file included from include/libiptc/libiptc.h:6,
from include/iptables.h:5,
from iptables-standalone.c:38:
/usr/src/kernels/2.6.18-1.2798.fc6-i586/include/linux/netfilter_ipv4/ip_tables.h:43:
error: IFNAMSIZ undeclared here (not in a function)


--
sashan
http://sashang.orcon.net.nz/


gcarter at aesgi

Jul 30, 2007, 7:37 PM

Post #2 of 3 (1197 views)
Permalink
Re: compiling extension modules with -std=c99 fails [In reply to]

Lots of reasons.

What version of kernel development shipped with your distro?

What version of gcc are you using?

-gc

Sashan Govender wrote:
> Hi
>
> Is there any reason why compiling the iptables extensions should fail
> when using -std=c99?
>
> cc -O2 -Wall -Wunused
> -I/usr/src/kernels/2.6.18-1.2798.fc6-i586/include -Iinclude/
> -DIPTABLES_VERSION=\"1.3.5\"
> -DIPT_LIB_DIR=\"/usr/local/lib/iptables\" -rdynamic -o iptables
> iptables-standalone.c iptables.o libiptc/libiptc.a -ldl -lnsl -std=c99
> In file included from include/libiptc/libiptc.h:6,
> from include/iptables.h:5,
> from iptables-standalone.c:38:
> /usr/src/kernels/2.6.18-1.2798.fc6-i586/include/linux/netfilter_ipv4/ip_tables.h:43:
> error: IFNAMSIZ undeclared here (not in a function)
>
>
>


sashang at gmail

Jul 31, 2007, 5:25 PM

Post #3 of 3 (1205 views)
Permalink
Re: compiling extension modules with -std=c99 fails [In reply to]

I've tried compiling it using 2.6.18 and 2.6.20. Using gcc (GCC) 4.1.1
20070105 (Red Hat 4.1.1-51). A patch to iptables like this:

--- kernel-2.6.20/linux-2.6.20/include/linux/netfilter_ipv4/ip_tables.h
2007-02-05 05:44:54.000000000 +1100
+++ kernel-2.6.20-skg/linux-2.6.20/include/linux/netfilter_ipv4/ip_tables.h
2007-07-31 14:22:41.000000000 +1000
@@ -16,7 +16,6 @@
#define _IPTABLES_H

#ifdef __KERNEL__
-#include <linux/if.h>
#include <linux/types.h>
#include <linux/in.h>
#include <linux/ip.h>
@@ -24,7 +23,7 @@
#endif
#include <linux/compiler.h>
#include <linux/netfilter_ipv4.h>
-
+#include <linux/if.h>
#include <linux/netfilter/x_tables.h>

#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN

allows me to compile the modules using -std=c99. The patch just
includes the file that contains the missing macro definition that gcc
was complaining about.

On 7/31/07, Gregory Carter <gcarter [at] aesgi> wrote:
> Lots of reasons.
>
> What version of kernel development shipped with your distro?
>
> What version of gcc are you using?
>
> -gc
>
> Sashan Govender wrote:
> > Hi
> >
> > Is there any reason why compiling the iptables extensions should fail
> > when using -std=c99?
> >
> > cc -O2 -Wall -Wunused
> > -I/usr/src/kernels/2.6.18-1.2798.fc6-i586/include -Iinclude/
> > -DIPTABLES_VERSION=\"1.3.5\"
> > -DIPT_LIB_DIR=\"/usr/local/lib/iptables\" -rdynamic -o iptables
> > iptables-standalone.c iptables.o libiptc/libiptc.a -ldl -lnsl -std=c99
> > In file included from include/libiptc/libiptc.h:6,
> > from include/iptables.h:5,
> > from iptables-standalone.c:38:
> > /usr/src/kernels/2.6.18-1.2798.fc6-i586/include/linux/netfilter_ipv4/ip_tables.h:43:
> > error: IFNAMSIZ undeclared here (not in a function)
> >
> >
> >
>

iptables user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.