netfilter & ipv6
Hi!
I have found that there seems to be a bunch of match & target modules for iptables that don't exist for ip6tables.. Like CLASSIFY for example. And some that exist have only a subset of the features.
Also some modules exist only for linux 2.4 but were never ported to 2.6 or don't compile cleanly anymore on the newest 2.6 kernels.
While I don't have that much experience of 2.6 yet and only have been hacking some smaller modules for 2.4 in the past, I think I should have enough skills to at least port/update some of these.
So I thought maybe I could help out with this task - ipv6 is something that I hope and think will take over ipv4 some day and I'd like for linux to be able to provide the same experience then as ipv4 users of iptables have today.
I have some questions..
1. Some modules (will) look almost identical on ipv4 on and ipv6 - would there be any point in making the ipv4 modules export some symbols and then re-use those methods in ipv6 if it wouldn't imply any (major) changes to the ipv4 modules?
2. I think it could be nice to keep track of what modules exist for ipv4 and ipv6 on some web page and maybe also let people sign up to join the porting effort (if there are any =). What do you think? And is that something I could help out with as well? I have a server at home that could run it, however behind an 0,5M adsl line..
3. If I succeed porting something, what should I name the patch to be sent to patch-o-matic-ng? I don't think I could just extend the existing ones as that would suggest the original authors have something to do with it and also some of them also are pending or already included in the ekernel. So, would CLASSIFY_v6 be an acceptable name for the ipv6 version of CLASSIFY? And maybe condition_26 for the 2.6 port of condition from 2.4? What's your general procedure if someone have updates to a module that someone else did? Should the original authors be contacted instead of sending patches to this list?
Any suggestions you have are welcome!
Signature · 1 line
- xkr47
Quoted 1 line · Jonas Berlin
3. If I succeed porting something, what should I name the patch to be sent to patch-o-matic-ng? I don't think I could just extend the existing ones as that would suggest the original authors have something to do with it and also some of them also are pending or already included in the ekernel. So, would
CLASSIFY_v6be an acceptable name for the ipv6 version of CLASSIFY?
After twisting some bits around, my CLASSIFY_v6 seems to work succesfully, however the naming is awkward since the name of the name of the module essentially determines the name of the target, the module etc. So one has to write
ip6tables ... -j CLASSIFY_v6 --set-class 1:20
Although this works fine, having some modules with suffix _v6 and some not is just plain confusing. Is there any way to reuse the CLASSIFY for ipv6 name without conflicting with the CLASSIFY module already in pom? Maybe I missed something?
Signature · 1 line
- xkr47
On Thu, February 10, 2005 9:07 am, Jonas Berlin said:
Hi Jonas!
Quoted 7 lines
ip6tables ... -j CLASSIFY_v6 --set-class 1:20Although this works fine, having some modules with suffix
_v6and some not is just plain confusing. Is there any way to reuse the CLASSIFY for ipv6 name without conflicting with the CLASSIFY module already in pom? Maybe I missed something?
You have to create an ipv6 directory into the CLASSIFY in pom.
CLASSIFY/linux/net/ipv6/netfilter/ip6t_CLASSIFY.c
Same for the include CLASSIFY/linux/include/linux/netfilter_ipv6/ip6t_CLASSIFY.h
Also, just register your target against ip6_tables with the same name as CLASSIFY would do with ip_tables. There's no conflict in that way.
All of this is a AFAIK.
Quoted 4 lines
--
- xkr47
Thanks for your effort,
Samuel
iptables compile error: NFC_IP_TOS undeclared
Hi, compiling iptables-1.3.0rc gives the following error:
Extensions found: IPv4:CLUSTERIP IPv4:mport IPv4:psd IPv4:recent
IPv4:ROUTE IPv4:set IPv4:SET IPv6:ah IPv6:esp IPv6:frag IPv6:ipv6header IPv6:hbh IPv6:dst IPv6:ROUTE IPv6:rt
gcc -O2 -Wall -Wunused -I/usr/src/linux-2.6.10-ct_sync-rc1/include -Iinclude/ -DIPTABLES_VERSION=\"1.3.0rc1\" -fPIC -o extensions/libipt_dscp_sh.o -c extensions/libipt_dscp.c extensions/libipt_dscp.c: In function `init':extensions/libipt_dscp.c:29: error: `NFC_IP_TOS' undeclared (first use in this function)extensions/libipt_dscp.c:29: error: (Each undeclared identifier is reported only onceextensions/libipt_dscp.c:29: error: for each function it appears in.) extensions/libipt_dscp.c: At top level:extensions/libipt_dscp_helper.c:69: warning: 'dscp_to_name' defined but not used
make: *** [extensions/libipt_dscp_sh.o] Error 1
Please help.
Re: iptables compile error: NFC_IP_TOS undeclared
Quoted 8 lines · Alexander Piavka
gcc -O2 -Wall -Wunused -I/usr/src/linux-2.6.10-ct_sync-rc1/include -Iinclude/ -DIPTABLES_VERSION=\"1.3.0rc1\" -fPIC -o
extensions/libipt_dscp_sh.o-cextensions/libipt_dscp.cextensions/libipt_dscp.c: In function `init':extensions/libipt_dscp.c:29: error: `NFC_IP_TOS' undeclared (first use in this function)
Could you give the output of the following three commands (run them from your iptables-1.3.0rc1 source directory):
grep NFC_IP_TOS/usr/src/linux-2.6.10-ct_sync-rc1/include/linux/netfilter_ipv4.h
grep netfilter_ipv4.h/usr/src/linux-2.6.10-ct_sync-rc1/include/linux/netfilter_ipv4/ip_tables.h
grep ip_tables.h extensions/libipt_dscp.c
That could help solve the problem.
Signature · 1 line
- xkr47
Re: iptables compile error: NFC_IP_TOS undeclared
Quoted 10 lines · Jonas Berlin
Quoted 8 lines · Alexander Piavka
gcc -O2 -Wall -Wunused -I/usr/src/linux-2.6.10-ct_sync-rc1/include -Iinclude/ -DIPTABLES_VERSION=\"1.3.0rc1\" -fPIC -o
extensions/libipt_dscp_sh.o-cextensions/libipt_dscp.cextensions/libipt_dscp.c: In function `init':extensions/libipt_dscp.c:29: error: `NFC_IP_TOS' undeclared (first use in this function)
Quoted 5 lines
Could you give the output of the following three commands (run them from your iptables-1.3.0rc1 source directory):
grep
NFC_IP_TOS/usr/src/linux-2.6.10-ct_sync-rc1/include/linux/netfilter_ipv4.h
no match
actually there is no match from NFC_IP_TOS in the whole /usr/src/linux-2.6.10-ct_sync-rc1/include subtree
Quoted 3 lines
grep
netfilter_ipv4.h/usr/src/linux-2.6.10-ct_sync-rc1/include/linux/netfilter_ipv4/ip_tables.h
#include <linux/netfilter_ipv4.h>
Quoted 2 lines
grep
ip_tables.hextensions/libipt_dscp.c
#include <linux/netfilter_ipv4/ip_tables.h>
Quoted 4 lines
That could help solve the problem.
--
Thanks
Re: iptables compile error: NFC_IP_TOS undeclared
Quoted 13 lines · Alexander Piavka
Quoted 10 lines · Jonas Berlin
Quoted 7 lines · Alexander Piavka
gcc -O2 -Wall -Wunused -I/usr/src/linux-2.6.10-ct_sync-rc1/include -Iinclude/ -DIPTABLES_VERSION=\"1.3.0rc1\" -fPIC -o
extensions/libipt_dscp_sh.o-cextensions/libipt_dscp.cextensions/libipt_dscp.c: In function `init':extensions/libipt_dscp.c:29: error: `NFC_IP_TOS' undeclared (first use in this function)
Quoted 10 lines
Quoted 4 lines
grep
NFC_IP_TOS/usr/src/linux-2.6.10-ct_sync-rc1/include/linux/netfilter_ipv4.hno match
actually there is no match from
NFC_IP_TOSin the whole/usr/src/linux-2.6.10-ct_sync-rc1/includesubtree
Ok, I'm not that familiar with different kernel versions, but my 2.6.10 at least has that one. Could it be that the ct_sync patch takes it away? Do you have ct_sync as a patch or did you get the kernel pre-patched?
Signature · 1 line
- xkr47
Re: iptables compile error: NFC_IP_TOS undeclared
Quoted 8 lines · Jonas Berlin
Quoted 5 lines · Alexander Piavka
actually there is no match from
NFC_IP_TOSin the whole/usr/src/linux-2.6.10-ct_sync-rc1/includesubtreeOk, I'm not that familiar with different kernel versions, but my 2.6.10 at least has that one. Could it be that the
ct_syncpatch takes it away? Do you havect_syncas a patch or did you get the kernel pre-patched?
Yes, it reuses the bits to record state changes. The nfcache bits don't affect any functionality, just define it to anything you want or remove it.
Regards
Patrick
PATCH 1/1 kill NFC_* stuff in iptables [was Re: iptables compile error: NFC_IP_TOS undeclared]
Hi Patrick,
Quoted 9 lines · Patrick McHardy
Quoted 7 lines · Jonas Berlin
Quoted 5 lines · Alexander Piavka
actually there is no match from
NFC_IP_TOSin the whole/usr/src/linux-2.6.10-ct_sync-rc1/includesubtree
Quoted 6 lines
Quoted 1 line
Ok, I'm not that familiar with different kernel versions, but my 2.6.10 at least has that one. Could it be that the
ct_syncpatch takes it away? Do you havect_syncas a patch or did you get the kernel pre-patched?Yes, it reuses the bits to record state changes. The nfcache bits don't affect any functionality, just define it to anything you want or remove it.
I've renamed all NFC_* stuff != NFC_UNKNOWN to NFC_UNKNOWN. So people using ct_sync won't complain about this again. I see this as a first step to remove the old behaviour of nfcache. Please, see the patch attached.
--
Pablo
iptables.c +6 -6
@@ -1987,7 +1987,7 @@ && (fw.ip.invflags & IPT_INV_PROTO))exit_error (PARAMETER_PROBLEM ,"rule would never match protocol" ); - fw.nfcache |=NFC_IP_PROTO ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 's' :
@@ -1995,7 +1995,7 @@set_option (&options,OPT_SOURCE , &fw.ip.invflags, invert); shostnetworkmask = argv[optind-1 ]; - fw.nfcache |=NFC_IP_SRC ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 'd' :
@@ -2003,7 +2003,7 @@set_option (&options,OPT_DESTINATION , &fw.ip.invflags, invert); dhostnetworkmask = argv[optind-1 ]; - fw.nfcache |=NFC_IP_DST ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 'j' :
@@ -2037,7 +2037,7 @@parse_interface (argv[optind-1 ], fw.ip.iniface, fw.ip.iniface_mask); - fw.nfcache |=NFC_IP_IF_IN ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 'o' :
@@ -2047,14 +2047,14 @@parse_interface (argv[optind-1 ], fw.ip.outiface, fw.ip.outiface_mask); - fw.nfcache |=NFC_IP_IF_OUT ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 'f' :set_option (&options,OPT_FRAGMENT , &fw.ip.invflags, invert); fw.ip.flags |=IPT_F_FRAG ; - fw.nfcache |=NFC_IP_FRAG ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 'v' :
libip4tc.c +0 -11
@@ -149,17 +149,6 @@printf ("Cache: %08X " , e->nfcache);if (e->nfcache &NFC_ALTERED )printf ("ALTERED " );if (e->nfcache &NFC_UNKNOWN )printf ("UNKNOWN " ); -if (e->nfcache &NFC_IP_SRC )printf ("IP_SRC " ); -if (e->nfcache &NFC_IP_DST )printf ("IP_DST " ); -if (e->nfcache &NFC_IP_IF_IN )printf ("IP_IF_IN " ); -if (e->nfcache &NFC_IP_IF_OUT )printf ("IP_IF_OUT " ); -if (e->nfcache &NFC_IP_TOS )printf ("IP_TOS " ); -if (e->nfcache &NFC_IP_PROTO )printf ("IP_PROTO " ); -if (e->nfcache &NFC_IP_OPTIONS )printf ("IP_OPTIONS " ); -if (e->nfcache &NFC_IP_TCPFLAGS )printf ("IP_TCPFLAGS " ); -if (e->nfcache &NFC_IP_SRC_PT )printf ("IP_SRC_PT " ); -if (e->nfcache &NFC_IP_DST_PT )printf ("IP_DST_PT " ); -if (e->nfcache &NFC_IP_PROTO_UNKNOWN )printf ("IP_PROTO_UNKNOWN " );printf ("\n" );IPT_MATCH_ITERATE (e, print_match);
libip6tc.c +0 -11
@@ -180,17 +180,6 @@printf ("Cache: %08X " , e->nfcache);if (e->nfcache &NFC_ALTERED )printf ("ALTERED " );if (e->nfcache &NFC_UNKNOWN )printf ("UNKNOWN " ); -if (e->nfcache &NFC_IP6_SRC )printf ("IP6_SRC " ); -if (e->nfcache &NFC_IP6_DST )printf ("IP6_DST " ); -if (e->nfcache &NFC_IP6_IF_IN )printf ("IP6_IF_IN " ); -if (e->nfcache &NFC_IP6_IF_OUT )printf ("IP6_IF_OUT " ); -if (e->nfcache &NFC_IP6_TOS )printf ("IP6_TOS " ); -if (e->nfcache &NFC_IP6_PROTO )printf ("IP6_PROTO " ); -if (e->nfcache &NFC_IP6_OPTIONS )printf ("IP6_OPTIONS " ); -if (e->nfcache &NFC_IP6_TCPFLAGS )printf ("IP6_TCPFLAGS " ); -if (e->nfcache &NFC_IP6_SRC_PT )printf ("IP6_SRC_PT " ); -if (e->nfcache &NFC_IP6_DST_PT )printf ("IP6_DST_PT " ); -if (e->nfcache &NFC_IP6_PROTO_UNKNOWN )printf ("IP6_PROTO_UNKNOWN " );printf ("\n" );IP6T_MATCH_ITERATE (e, print_match);
libip6t_multiport.c +3 -3
@@ -117,7 +117,7 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IP6T_MULTIPORT_SOURCE ; - *nfcache |=NFC_IP6_SRC_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '2' :
@@ -126,7 +126,7 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IP6T_MULTIPORT_DESTINATION ; - *nfcache |=NFC_IP6_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '3' :
@@ -135,7 +135,7 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IP6T_MULTIPORT_EITHER ; - *nfcache |=NFC_IP6_SRC_PT |NFC_IP6_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;default :
libipt_multiport.c +6 -6
@@ -179,7 +179,7 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IPT_MULTIPORT_SOURCE ; - *nfcache |=NFC_IP_SRC_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '2' :
@@ -188,7 +188,7 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IPT_MULTIPORT_DESTINATION ; - *nfcache |=NFC_IP_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '3' :
@@ -197,7 +197,7 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IPT_MULTIPORT_EITHER ; - *nfcache |=NFC_IP_SRC_PT |NFC_IP_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;default :
@@ -231,7 +231,7 @@ proto =check_proto (entry);parse_multi_ports_v1 (argv[optind-1 ], multiinfo, proto); multiinfo->flags =IPT_MULTIPORT_SOURCE ; - *nfcache |=NFC_IP_SRC_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '2' :
@@ -239,7 +239,7 @@ proto =check_proto (entry);parse_multi_ports_v1 (argv[optind-1 ], multiinfo, proto); multiinfo->flags =IPT_MULTIPORT_DESTINATION ; - *nfcache |=NFC_IP_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '3' :
@@ -247,7 +247,7 @@ proto =check_proto (entry);parse_multi_ports_v1 (argv[optind-1 ], multiinfo, proto); multiinfo->flags =IPT_MULTIPORT_EITHER ; - *nfcache |=NFC_IP_SRC_PT |NFC_IP_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;default :
libipt_tos.c +1 -1
@@ -51,7 +51,7 @@static void init (struct ipt_entry_match *m,unsigned int *nfcache) { - *nfcache |=NFC_IP_TOS ; + *nfcache |=NFC_UNKNOWN ; } static void
libipt_TCPLAG.c +0 -12
@@ -70,18 +70,6 @@* our own private data structure (which is at t->data). * Probably we could fiddle with t->tflags too but there is * no great advantage in doing so. -* -* TODO: Find documentation for the above flags which -* can be ored into nfcache... -* -* NFC_IP6_DST_PT -* NFC_IP6_PROTO_UNKNOWN -* NFC_IP6_SRC_PT -* NFC_IP6_TCPFLAGS -* NFC_IP_DST_PT -* NFC_IP_SRC_PT -* NFC_IP_TOS -* NFC_UNKNOWN -- This one seems safest */ static void init (struct ipt_entry_target *t,unsigned int *nfcache ) {
libip6t_udp.c +2 -2
@@ -109,7 +109,7 @@if (invert) udpinfo->invflags |=IP6T_UDP_INV_SRCPT ; *flags |=UDP_SRC_PORTS ; - *nfcache |=NFC_IP6_SRC_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '2' :
@@ -121,7 +121,7 @@if (invert) udpinfo->invflags |=IP6T_UDP_INV_DSTPT ; *flags |=UDP_DST_PORTS ; - *nfcache |=NFC_IP6_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;default :
libipt_tcpmss.c +1 -1
@@ -28,7 +28,7 @@static void init (struct ipt_entry_match *m,unsigned int *nfcache) { - *nfcache |=NFC_IP_PROTO_UNKNOWN ; + *nfcache |=NFC_UNKNOWN ; } static u_int16_t
libip6t_tcp.c +5 -5
@@ -187,7 +187,7 @@if (invert) tcpinfo->invflags |=IP6T_TCP_INV_SRCPT ; *flags |=TCP_SRC_PORTS ; - *nfcache |=NFC_IP6_SRC_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '2' :
@@ -199,7 +199,7 @@if (invert) tcpinfo->invflags |=IP6T_TCP_INV_DSTPT ; *flags |=TCP_DST_PORTS ; - *nfcache |=NFC_IP6_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '3' :
@@ -209,7 +209,7 @@ " allowed");parse_tcp_flags (tcpinfo,"SYN,RST,ACK" ,"SYN" , invert); *flags |=TCP_FLAGS ; - *nfcache |=NFC_IP6_TCPFLAGS ; + *nfcache |=NFC_UNKNOWN ;break ;case '4' :
@@ -228,7 +228,7 @@ invert); optind++; *flags |=TCP_FLAGS ; - *nfcache |=NFC_IP6_TCPFLAGS ; + *nfcache |=NFC_UNKNOWN ;break ;case '5' :
@@ -240,7 +240,7 @@if (invert) tcpinfo->invflags |=IP6T_TCP_INV_OPTION ; *flags |=TCP_OPTION ; - *nfcache |=NFC_IP6_PROTO_UNKNOWN ; + *nfcache |=NFC_UNKNOWN ;break ;default :
libipt_mport.c +3 -3
@@ -140,7 +140,7 @@ proto =check_proto (entry);parse_multi_ports (argv[optind-1 ], minfo, proto); minfo->flags =IPT_MPORT_SOURCE ; - *nfcache |=NFC_IP_SRC_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '2' :
@@ -148,7 +148,7 @@ proto =check_proto (entry);parse_multi_ports (argv[optind-1 ], minfo, proto); minfo->flags =IPT_MPORT_DESTINATION ; - *nfcache |=NFC_IP_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '3' :
@@ -156,7 +156,7 @@ proto =check_proto (entry);parse_multi_ports (argv[optind-1 ], minfo, proto); minfo->flags =IPT_MPORT_EITHER ; - *nfcache |=NFC_IP_SRC_PT |NFC_IP_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;default :
libipt_sctp.c +2 -2
@@ -293,7 +293,7 @@if (invert) einfo->invflags |=IPT_SCTP_SRC_PORTS ; *flags |=IPT_SCTP_SRC_PORTS ; - *nfcache |=NFC_IP_SRC_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '2' :
@@ -306,7 +306,7 @@if (invert) einfo->invflags |=IPT_SCTP_DEST_PORTS ; *flags |=IPT_SCTP_DEST_PORTS ; - *nfcache |=NFC_IP_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '3' :
libipt_icmp.c +4 -8
@@ -114,7 +114,7 @@ {0} }; -static unsigned int +static void parse_icmp (const char *icmptype,u_int8_t *type,u_int8_t code[]) {unsigned int limit =sizeof (icmp_codes)/sizeof (struct icmp_names );
@@ -165,10 +165,6 @@ code[1 ] =0xFF ; } } - -if (code[0 ] ==0 && code[1 ] ==0xFF ) -return NFC_IP_SRC_PT ; -else return NFC_IP_SRC_PT |NFC_IP_DST_PT ; }/* Initialize the match. */
@@ -194,9 +190,9 @@switch (c) {case '1' :check_inverse (optarg, &invert, &optind,0 ); - *nfcache |=parse_icmp (argv[optind-1 ], - &icmpinfo->type, - icmpinfo->code); + *nfcache |=NFC_UNKNOWN ; +parse_icmp (argv[optind-1 ], &icmpinfo->type, + icmpinfo->code);if (invert) icmpinfo->invflags |=IPT_ICMP_INV ;break ;
libipt_dscp.c +1 -1
@@ -26,7 +26,7 @@static void init (struct ipt_entry_match *m,unsigned int *nfcache) { - *nfcache |=NFC_IP_TOS ; + *nfcache |=NFC_UNKNOWN ; }static void help (void )
libip6t_icmpv6.c +4 -8
@@ -90,7 +90,7 @@ {0} }; -static unsigned int +static void parse_icmpv6 (const char *icmpv6type,u_int8_t *type,u_int8_t code[]) {unsigned int limit =sizeof (icmpv6_codes)/sizeof (struct icmpv6_names );
@@ -141,10 +141,6 @@ code[1 ] =0xFF ; } } - -if (code[0 ] ==0 && code[1 ] ==0xFF ) -return NFC_IP6_SRC_PT ; -else return NFC_IP6_SRC_PT |NFC_IP6_DST_PT ; }/* Initialize the match. */
@@ -169,9 +165,9 @@switch (c) {case '1' :check_inverse (optarg, &invert, &optind,0 ); - *nfcache |=parse_icmpv6 (argv[optind-1 ], - &icmpv6info->type, - icmpv6info->code); + *nfcache |=NFC_UNKNOWN ; +parse_icmpv6 (argv[optind-1 ], &icmpv6info->type, + icmpv6info->code);if (invert) icmpv6info->invflags |=IP6T_ICMP_INV ;break ;
libipt_udp.c +2 -2
@@ -109,7 +109,7 @@if (invert) udpinfo->invflags |=IPT_UDP_INV_SRCPT ; *flags |=UDP_SRC_PORTS ; - *nfcache |=NFC_IP_SRC_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '2' :
@@ -121,7 +121,7 @@if (invert) udpinfo->invflags |=IPT_UDP_INV_DSTPT ; *flags |=UDP_DST_PORTS ; - *nfcache |=NFC_IP_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;default :
libipt_ecn.c +1 -1
@@ -18,7 +18,7 @@static void init (struct ipt_entry_match *m,unsigned int *nfcache) { - *nfcache |=NFC_IP_TOS ; + *nfcache |=NFC_UNKNOWN ; }static void help (void )
libipt_tcp.c +5 -5
@@ -187,7 +187,7 @@if (invert) tcpinfo->invflags |=IPT_TCP_INV_SRCPT ; *flags |=TCP_SRC_PORTS ; - *nfcache |=NFC_IP_SRC_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '2' :
@@ -199,7 +199,7 @@if (invert) tcpinfo->invflags |=IPT_TCP_INV_DSTPT ; *flags |=TCP_DST_PORTS ; - *nfcache |=NFC_IP_DST_PT ; + *nfcache |=NFC_UNKNOWN ;break ;case '3' :
@@ -209,7 +209,7 @@ " allowed");parse_tcp_flags (tcpinfo,"SYN,RST,ACK" ,"SYN" , invert); *flags |=TCP_FLAGS ; - *nfcache |=NFC_IP_TCPFLAGS ; + *nfcache |=NFC_UNKNOWN ;break ;case '4' :
@@ -228,7 +228,7 @@ invert); optind++; *flags |=TCP_FLAGS ; - *nfcache |=NFC_IP_TCPFLAGS ; + *nfcache |=NFC_UNKNOWN ;break ;case '5' :
@@ -240,7 +240,7 @@if (invert) tcpinfo->invflags |=IPT_TCP_INV_OPTION ; *flags |=TCP_OPTION ; - *nfcache |=NFC_IP_PROTO_UNKNOWN ; + *nfcache |=NFC_UNKNOWN ;break ;default :
ip6tables.c +5 -5
@@ -1887,7 +1887,7 @@ && (fw.ipv6.invflags & IP6T_INV_PROTO))exit_error (PARAMETER_PROBLEM ,"rule would never match protocol" ); - fw.nfcache |=NFC_IP6_PROTO ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 's' :
@@ -1895,7 +1895,7 @@set_option (&options,OPT_SOURCE , &fw.ipv6.invflags, invert); shostnetworkmask = argv[optind-1 ]; - fw.nfcache |=NFC_IP6_SRC ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 'd' :
@@ -1903,7 +1903,7 @@set_option (&options,OPT_DESTINATION , &fw.ipv6.invflags, invert); dhostnetworkmask = argv[optind-1 ]; - fw.nfcache |=NFC_IP6_DST ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 'j' :
@@ -1935,7 +1935,7 @@parse_interface (argv[optind-1 ], fw.ipv6.iniface, fw.ipv6.iniface_mask); - fw.nfcache |=NFC_IP6_IF_IN ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 'o' :
@@ -1945,7 +1945,7 @@parse_interface (argv[optind-1 ], fw.ipv6.outiface, fw.ipv6.outiface_mask); - fw.nfcache |=NFC_IP6_IF_OUT ; + fw.nfcache |=NFC_UNKNOWN ;break ;case 'v' :
Re: [PATCH] kill NFC_* stuff in iptables [was Re: iptables compile error: NFC_IP_TOS undeclared]
Quoted 1 line · Pablo Neira
I've renamed all NFC_* stuff !=
NFC_UNKNOWNtoNFC_UNKNOWN. So people usingct_syncwon't complain about this again. I see this as a first step to remove the old behaviour of nfcache. Please, see the patch attached.
Why didn't you remove it entirely instead ?
Regards
Patrick
Re: [PATCH] kill NFC_* stuff in iptables [was Re: iptables compile error: NFC_IP_TOS undeclared]
Quoted 6 lines · Patrick McHardy
Quoted 1 line · Pablo Neira
I've renamed all NFC_* stuff !=
NFC_UNKNOWNtoNFC_UNKNOWN. So people usingct_syncwon't complain about this again. I see this as a first step to remove the old behaviour of nfcache. Please, see the patch attached.Why didn't you remove it entirely instead ?
true :), patch attached. I've gzip'ed it, it's too big for sending it in clear text.
Next step, what do you think about removing nfcache passed as parameter from the iptables API?
--
Pablo
Re: [PATCH] kill NFC_* stuff in iptables [was Re: iptables compile error: NFC_IP_TOS undeclared]
Quoted 5 lines · Pablo Neira
Quoted 1 line · Patrick McHardy
Why didn't you remove it entirely instead ?
true :), patch attached. I've gzip'ed it, it's too big for sending it in clear text.
Thanks a lot. Hopeing I don't annoy you .. I haven't actually checked the API, but can't we remove all those now empty init functions ? If not I think it would be nicer to change the API to check for ->init == NULL instead of leaving all these empty funtion bodies around.
Quoted 1 line
Next step, what do you think about removing nfcache passed as parameter from the iptables API?
I don't think we can remove it from struct ipt_entry without breaking userspace compatibility. But we could stop using it.
Regards
Patrick
Re: [PATCH] kill NFC_* stuff in iptables [was Re: iptables compile error: NFC_IP_TOS undeclared]
Quoted 7 lines · Patrick McHardy
Quoted 4 lines
Quoted 1 line
Why didn't you remove it entirely instead ?
true :), patch attached. I've gzip'ed it, it's too big for sending it in clear text.
Thanks a lot. Hopeing I don't annoy you ..
No way, thanks Patrick.
Quoted 4 lines
I haven't actually checked
the API, but can't we remove all those now empty init functions ? If not I think it would be nicer to change the API to check for ->init == NULL instead of leaving all these empty funtion bodies around.
Yes, I agree and I did it, I must confess that it was kinda boring a bit. See the patch attached.
Quoted 5 lines
Quoted 1 line
Next step, what do you think about removing nfcache passed as parameter from the iptables API?
I don't think we can remove it from struct
ipt_entrywithout breaking userspace compatibility. But we could stop using it.
Yes, I was aware of that :). I didn't talk about modifying ipt_entry which is not possible because of backward compatibility. I mean that, as next step, we could kill those nfcache arguments passed as parameter that aren't useful anymore.
--
Pablo
iptables.c +8 -10
@@ -1987,7 +1987,6 @@ && (fw.ip.invflags & IPT_INV_PROTO))exit_error (PARAMETER_PROBLEM ,"rule would never match protocol" ); - fw.nfcache |=NFC_IP_PROTO ;break ;case 's' :
@@ -1995,7 +1994,6 @@set_option (&options,OPT_SOURCE , &fw.ip.invflags, invert); shostnetworkmask = argv[optind-1 ]; - fw.nfcache |=NFC_IP_SRC ;break ;case 'd' :
@@ -2003,7 +2001,6 @@set_option (&options,OPT_DESTINATION , &fw.ip.invflags, invert); dhostnetworkmask = argv[optind-1 ]; - fw.nfcache |=NFC_IP_DST ;break ;case 'j' :
@@ -2024,7 +2021,8 @@strcpy (target->t->u.user.name, jumpto);set_revision (target->t->u.user.name, target->revision); - target->init (target->t, &fw.nfcache); +if (target->init !=NULL ) + target->init (target->t, &fw.nfcache); opts =merge_options (opts, target->extra_opts, &target->option_offset); }break ;
@@ -2037,7 +2035,6 @@parse_interface (argv[optind-1 ], fw.ip.iniface, fw.ip.iniface_mask); - fw.nfcache |=NFC_IP_IF_IN ;break ;case 'o' :
@@ -2047,14 +2044,12 @@parse_interface (argv[optind-1 ], fw.ip.outiface, fw.ip.outiface_mask); - fw.nfcache |=NFC_IP_IF_OUT ;break ;case 'f' :set_option (&options,OPT_FRAGMENT , &fw.ip.invflags, invert); fw.ip.flags |=IPT_F_FRAG ; - fw.nfcache |=NFC_IP_FRAG ;break ;case 'v' :
@@ -2078,7 +2073,8 @@ m->m->u.match_size = size;strcpy (m->m->u.user.name, m->name);set_revision (m->m->u.user.name, m->revision); - m->init (m->m, &fw.nfcache); +if (m->init !=NULL ) + m->init (m->m, &fw.nfcache); opts =merge_options (opts, m->extra_opts, &m->option_offset); }break ;
@@ -2221,7 +2217,8 @@strcpy (m->m->u.user.name, m->name);set_revision (m->m->u.user.name, m->revision); - m->init (m->m, &fw.nfcache); +if (m->init !=NULL ) + m->init (m->m, &fw.nfcache); opts =merge_options (opts, m->extra_opts, &m->option_offset);
@@ -2349,7 +2346,8 @@ target->t->u.target_size = size;strcpy (target->t->u.user.name, jumpto);set_revision (target->t->u.user.name, target->revision); - target->init (target->t, &fw.nfcache); +if (target->init !=NULL ) + target->init (target->t, &fw.nfcache); }if (!target) {
libip4tc.c +0 -11
@@ -149,17 +149,6 @@printf ("Cache: %08X " , e->nfcache);if (e->nfcache &NFC_ALTERED )printf ("ALTERED " );if (e->nfcache &NFC_UNKNOWN )printf ("UNKNOWN " ); -if (e->nfcache &NFC_IP_SRC )printf ("IP_SRC " ); -if (e->nfcache &NFC_IP_DST )printf ("IP_DST " ); -if (e->nfcache &NFC_IP_IF_IN )printf ("IP_IF_IN " ); -if (e->nfcache &NFC_IP_IF_OUT )printf ("IP_IF_OUT " ); -if (e->nfcache &NFC_IP_TOS )printf ("IP_TOS " ); -if (e->nfcache &NFC_IP_PROTO )printf ("IP_PROTO " ); -if (e->nfcache &NFC_IP_OPTIONS )printf ("IP_OPTIONS " ); -if (e->nfcache &NFC_IP_TCPFLAGS )printf ("IP_TCPFLAGS " ); -if (e->nfcache &NFC_IP_SRC_PT )printf ("IP_SRC_PT " ); -if (e->nfcache &NFC_IP_DST_PT )printf ("IP_DST_PT " ); -if (e->nfcache &NFC_IP_PROTO_UNKNOWN )printf ("IP_PROTO_UNKNOWN " );printf ("\n" );IPT_MATCH_ITERATE (e, print_match);
libip6tc.c +0 -11
@@ -180,17 +180,6 @@printf ("Cache: %08X " , e->nfcache);if (e->nfcache &NFC_ALTERED )printf ("ALTERED " );if (e->nfcache &NFC_UNKNOWN )printf ("UNKNOWN " ); -if (e->nfcache &NFC_IP6_SRC )printf ("IP6_SRC " ); -if (e->nfcache &NFC_IP6_DST )printf ("IP6_DST " ); -if (e->nfcache &NFC_IP6_IF_IN )printf ("IP6_IF_IN " ); -if (e->nfcache &NFC_IP6_IF_OUT )printf ("IP6_IF_OUT " ); -if (e->nfcache &NFC_IP6_TOS )printf ("IP6_TOS " ); -if (e->nfcache &NFC_IP6_PROTO )printf ("IP6_PROTO " ); -if (e->nfcache &NFC_IP6_OPTIONS )printf ("IP6_OPTIONS " ); -if (e->nfcache &NFC_IP6_TCPFLAGS )printf ("IP6_TCPFLAGS " ); -if (e->nfcache &NFC_IP6_SRC_PT )printf ("IP6_SRC_PT " ); -if (e->nfcache &NFC_IP6_DST_PT )printf ("IP6_DST_PT " ); -if (e->nfcache &NFC_IP6_PROTO_UNKNOWN )printf ("IP6_PROTO_UNKNOWN " );printf ("\n" );IP6T_MATCH_ITERATE (e, print_match);
libipt_connlimit.c +0 -9
@@ -26,14 +26,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int
@@ -127,7 +119,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_connlimit_info)), .userspacesize = offsetof(struct ipt_connlimit_info,data), .help = help, - .init = init, .parse = parse, .final_check = final_check, .print = print,
libipt_account.c +0 -1
@@ -168,7 +168,6 @@struct t_ipt_account_info *info = (struct t_ipt_account_info *)(match)->data; - *nfcache |=NFC_UNKNOWN ;/* set default table name to DEFAULT */ strncpy (info->name,"DEFAULT" ,IPT_ACCOUNT_NAME_LEN );
libipt_pkttype.c +0 -6
@@ -69,11 +69,6 @@ {0} }; -static void init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} -static void parse_pkttype (const char *pkttype,struct ipt_pkttype_info *info) {unsigned int i;
@@ -159,7 +154,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_pkttype_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_pkttype_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_random.c +0 -1
@@ -52,7 +52,6 @@ init(struct ip6t_entry_match *m, unsigned int *nfcache) { struct ip6t_rand_info *randinfo = (struct ip6t_rand_info *)(m)->data; - *nfcache |=NFC_UNKNOWN ;/* We assign the average to be 50 which is our default value */ /* 50 * 2.55 = 128 */
libipt_IPV4OPTSSTRIP.c +0 -6
@@ -13,11 +13,6 @@#include <iptables.h> #include <linux/netfilter_ipv4/ip_tables.h> -static void init (struct ipt_entry_target *t,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} -static void help (void ) { printf("IPV4OPTSSTRIP v%s target takes no option !! Make sure you use it in the mangle table.\n",
@@ -66,7 +61,6 @@ .size = IPT_ALIGN(0), .userspacesize = IPT_ALIGN(0), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_childlevel.c +0 -7
@@ -39,12 +39,6 @@ { .name = 0 } }; -/* Initialize the match. */ -static void init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int parse(int c, char **argv, int invert, unsigned int *flags, const struct ipt_entry *entry, unsigned int *nfcache,
@@ -108,7 +102,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_childlevel_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_childlevel_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_conntrack.c +0 -9
@@ -56,14 +56,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} -static int parse_state (const char *state,size_t strlen,struct ipt_conntrack_info *sinfo) {
@@ -538,7 +530,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_conntrack_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_conntrack_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_multiport.c +0 -3
@@ -117,7 +117,6 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IP6T_MULTIPORT_SOURCE ; - *nfcache |=NFC_IP6_SRC_PT ;break ;case '2' :
@@ -126,7 +125,6 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IP6T_MULTIPORT_DESTINATION ; - *nfcache |=NFC_IP6_DST_PT ;break ;case '3' :
@@ -135,7 +133,6 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IP6T_MULTIPORT_EITHER ; - *nfcache |=NFC_IP6_SRC_PT |NFC_IP6_DST_PT ;break ;default :
libipt_multiport.c +0 -6
@@ -179,7 +179,6 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IPT_MULTIPORT_SOURCE ; - *nfcache |=NFC_IP_SRC_PT ;break ;case '2' :
@@ -188,7 +187,6 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IPT_MULTIPORT_DESTINATION ; - *nfcache |=NFC_IP_DST_PT ;break ;case '3' :
@@ -197,7 +195,6 @@ multiinfo->count =parse_multi_ports (argv[optind-1 ], multiinfo->ports, proto); multiinfo->flags =IPT_MULTIPORT_EITHER ; - *nfcache |=NFC_IP_SRC_PT |NFC_IP_DST_PT ;break ;default :
@@ -231,7 +228,6 @@ proto =check_proto (entry);parse_multi_ports_v1 (argv[optind-1 ], multiinfo, proto); multiinfo->flags =IPT_MULTIPORT_SOURCE ; - *nfcache |=NFC_IP_SRC_PT ;break ;case '2' :
@@ -239,7 +235,6 @@ proto =check_proto (entry);parse_multi_ports_v1 (argv[optind-1 ], multiinfo, proto); multiinfo->flags =IPT_MULTIPORT_DESTINATION ; - *nfcache |=NFC_IP_DST_PT ;break ;case '3' :
@@ -247,7 +242,6 @@ proto =check_proto (entry);parse_multi_ports_v1 (argv[optind-1 ], multiinfo, proto); multiinfo->flags =IPT_MULTIPORT_EITHER ; - *nfcache |=NFC_IP_SRC_PT |NFC_IP_DST_PT ;break ;default :
libipt_REDIRECT.c +0 -2
@@ -33,8 +33,6 @@/* Actually, it's 0, but it's ignored at the moment. */ mr->rangesize =1 ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }/* Parses ports */
libipt_addrtype.c +0 -7
@@ -48,12 +48,6 @@help_types (); } -static void init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* caching not yet implemented */ - *nfcache |=NFC_UNKNOWN ; -} -static int parse_type (const char *name,size_t strlen,u_int16_t *mask) {
@@ -199,7 +193,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_addrtype_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_addrtype_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_fuzzy.c +0 -2
@@ -44,8 +44,6 @@ init(struct ip6t_entry_match *m, unsigned int *nfcache) { struct ip6t_fuzzy_info *presentinfo = (struct ip6t_fuzzy_info *)(m)->data; - *nfcache |=NFC_UNKNOWN ; -/* * Default rates ( I'll improve this very soon with something based * on real statistics of the running machine ) .
libipt_length.c +0 -8
@@ -25,13 +25,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} -static u_int16_t parse_length (const char *s) {
@@ -145,7 +138,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_length_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_length_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_hashlimit.c +0 -2
@@ -104,8 +104,6 @@ r->cfg.gc_interval =IPT_HASHLIMIT_GCINTERVAL ; r->cfg.expire =IPT_HASHLIMIT_EXPIRE ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }
libipt_MASQUERADE.c +0 -2
@@ -33,8 +33,6 @@/* Actually, it's 0, but it's ignored at the moment. */ mr->rangesize =1 ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }/* Parses ports */
libipt_fuzzy.c +0 -1
@@ -43,7 +43,6 @@ init(struct ipt_entry_match *m, unsigned int *nfcache) { struct ipt_fuzzy_info *presentinfo = (struct ipt_fuzzy_info *)(m)->data; - *nfcache |=NFC_UNKNOWN ;/* * Default rates ( I'll improve this very soon with something based
libipt_set.c +0 -2
@@ -47,8 +47,6 @@memset (info,0 ,sizeof (struct ipt_set_info_match )); -/* Can't cache this - XXX */ - *nfcache |=NFC_UNKNOWN ; }/* Function which parses command options; returns true if it ate an option */
libipt_realm.c +0 -9
@@ -28,14 +28,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int
@@ -122,7 +114,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_realm_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_realm_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_connbytes.c +0 -9
@@ -27,15 +27,7 @@ {0} }; -/* Initialize the match. */ static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} - -static void parse_range (const char *arg,struct ipt_connbytes_info *si) {char *colon,*p;
@@ -199,7 +191,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_connbytes_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_connbytes_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_tos.c +0 -8
@@ -47,14 +47,7 @@ {0} }; -/* Initialize the match. */ static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_IP_TOS ; -} - -static void parse_tos (const unsigned char *s,struct ipt_tos_info *info) {unsigned int i;
@@ -166,7 +159,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_tos_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_tos_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_LOG.c +0 -2
@@ -42,8 +42,6 @@ loginfo->level =LOG_DEFAULT_LEVEL ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }struct ip6t_log_names {
libipt_POOL.c +0 -2
@@ -51,8 +51,6 @@ ipi->src = ipi->dst =IP_POOL_NONE ; ipi->flags =0 ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }/* Function which parses command options; returns true if it
libipt_TCPLAG.c +0 -13
@@ -70,18 +70,6 @@* our own private data structure (which is at t->data). * Probably we could fiddle with t->tflags too but there is * no great advantage in doing so. -* -* TODO: Find documentation for the above flags which -* can be ored into nfcache... -* -* NFC_IP6_DST_PT -* NFC_IP6_PROTO_UNKNOWN -* NFC_IP6_SRC_PT -* NFC_IP6_TCPFLAGS -* NFC_IP_DST_PT -* NFC_IP_SRC_PT -* NFC_IP_TOS -* NFC_UNKNOWN -- This one seems safest */ static void init (struct ipt_entry_target *t,unsigned int *nfcache ) {
@@ -89,7 +77,6 @@memset ( el,0 ,sizeof (struct ipt_tcplag )); el->level =4 ;/* Default to warning level */ strcpy ( el->prefix,"TCPLAG:" );/* Give a reasonable default prefix */ - *nfcache |=NFC_UNKNOWN ; }/*
libip6t_udp.c +0 -2
@@ -109,7 +109,6 @@if (invert) udpinfo->invflags |=IP6T_UDP_INV_SRCPT ; *flags |=UDP_SRC_PORTS ; - *nfcache |=NFC_IP6_SRC_PT ;break ;case '2' :
@@ -121,7 +120,6 @@if (invert) udpinfo->invflags |=IP6T_UDP_INV_DSTPT ; *flags |=UDP_DST_PORTS ; - *nfcache |=NFC_IP6_DST_PT ;break ;default :
libipt_recent.c +0 -1
@@ -72,7 +72,6 @@ {struct ipt_recent_info *info = (struct ipt_recent_info *)(match)->data; - *nfcache |=NFC_UNKNOWN ;strncpy (info->name,"DEFAULT" ,IPT_RECENT_NAME_LEN );/* eventhough IPT_RECENT_NAME_LEN is currently defined as 200,
libipt_random.c +0 -1
@@ -51,7 +51,6 @@ init(struct ipt_entry_match *m, unsigned int *nfcache) { struct ipt_rand_info *randinfo = (struct ipt_rand_info *)(m)->data; - *nfcache |=NFC_UNKNOWN ;/* We assign the average to be 50 which is our default value */ /* 50 * 2.55 = 128 */
libipt_unclean.c +0 -9
@@ -17,14 +17,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this. */ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int
@@ -49,7 +41,6 @@ .size = IPT_ALIGN(0), .userspacesize = IPT_ALIGN(0), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = NULL,
libipt_dstlimit.c +0 -2
@@ -105,8 +105,6 @@ r->cfg.gc_interval =IPT_DSTLIMIT_GCINTERVAL ; r->cfg.expire =IPT_DSTLIMIT_EXPIRE ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }#define PARAM_LIMIT 0x00000001
libipt_nth.c +0 -8
@@ -50,13 +50,6 @@ { 0 } }; -/* Initialize the target. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} -#define IPT_NTH_OPT_EVERY 0x01#define IPT_NTH_OPT_NOT_EVERY 0x02#define IPT_NTH_OPT_START 0x04
@@ -224,7 +217,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_nth_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_nth_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_mac.c +0 -9
@@ -28,15 +28,7 @@ {0} }; -/* Initialize the match. */ static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} - -static void parse_mac (const char *mac,struct ipt_mac_info *info) {unsigned int i =0 ;
@@ -135,7 +127,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_mac_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_mac_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_TARPIT.c +0 -8
@@ -15,13 +15,6 @@ { 0 } }; -static void -init (struct ipt_entry_target *t,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} - static int parse(int c, char **argv, int invert, unsigned int *flags, const struct ipt_entry *entry,
@@ -52,7 +45,6 @@ .size = IPT_ALIGN(0), .userspacesize = IPT_ALIGN(0), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_ttl.c +0 -7
@@ -24,12 +24,6 @@ , IPTABLES_VERSION); } -static void init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* caching not yet implemented */ - *nfcache |=NFC_UNKNOWN ; -} -static int parse (int c,char **argv,int invert,unsigned int *flags,const struct ipt_entry *entry,unsigned int *nfcache,struct ipt_entry_match **match)
@@ -156,7 +150,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_ttl_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_ttl_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_SNAT.c +0 -9
@@ -33,14 +33,6 @@ { 0 } }; -/* Initialize the target. */ -static void -init (struct ipt_entry_target *t,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} -static struct ipt_natinfo *append_range (struct ipt_natinfo *info,const struct ip_nat_range *range) {
@@ -236,7 +228,6 @@ .size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)), .userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_tcpmss.c +0 -8
@@ -24,13 +24,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_IP_PROTO_UNKNOWN ; -} -static u_int16_t parse_tcp_mssvalue (const char *mssvalue) {
@@ -146,7 +139,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_tcpmss_match_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_tcpmss_match_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_connrate.c +0 -9
@@ -34,14 +34,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* caching not yet implemented */ - *nfcache |=NFC_UNKNOWN ; -} -static u_int32_t parse_value (const char *arg,u_int32_t def) {
@@ -174,7 +166,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_connrate_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_connrate_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_tcp.c +0 -5
@@ -187,7 +187,6 @@if (invert) tcpinfo->invflags |=IP6T_TCP_INV_SRCPT ; *flags |=TCP_SRC_PORTS ; - *nfcache |=NFC_IP6_SRC_PT ;break ;case '2' :
@@ -199,7 +198,6 @@if (invert) tcpinfo->invflags |=IP6T_TCP_INV_DSTPT ; *flags |=TCP_DST_PORTS ; - *nfcache |=NFC_IP6_DST_PT ;break ;case '3' :
@@ -209,7 +207,6 @@ " allowed");parse_tcp_flags (tcpinfo,"SYN,RST,ACK" ,"SYN" , invert); *flags |=TCP_FLAGS ; - *nfcache |=NFC_IP6_TCPFLAGS ;break ;case '4' :
@@ -228,7 +225,6 @@ invert); optind++; *flags |=TCP_FLAGS ; - *nfcache |=NFC_IP6_TCPFLAGS ;break ;case '5' :
@@ -240,7 +236,6 @@if (invert) tcpinfo->invflags |=IP6T_TCP_INV_OPTION ; *flags |=TCP_OPTION ; - *nfcache |=NFC_IP6_PROTO_UNKNOWN ;break ;default :
libipt_state.c +0 -9
@@ -28,14 +28,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} -static int parse_state (const char *state,size_t strlen,struct ipt_state_info *sinfo) {
@@ -158,7 +150,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_state_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_state_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_owner.c +0 -9
@@ -47,14 +47,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ip6t_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this. */ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int
@@ -243,7 +235,6 @@ .size = IP6T_ALIGN(sizeof(struct ip6t_owner_info)), .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_owner_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_IPMARK.c +0 -1
@@ -53,7 +53,6 @@ ipmarkinfo->andmask=0xffffffff ; ipmarkinfo->ormask=0 ; - *nfcache |=NFC_UNKNOWN ; }/* Function which parses command options; returns true if it
libipt_owner.c +0 -9
@@ -49,14 +49,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this. */ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int
@@ -245,7 +237,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_owner_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_owner_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_mport.c +0 -3
@@ -140,7 +140,6 @@ proto =check_proto (entry);parse_multi_ports (argv[optind-1 ], minfo, proto); minfo->flags =IPT_MPORT_SOURCE ; - *nfcache |=NFC_IP_SRC_PT ;break ;case '2' :
@@ -148,7 +147,6 @@ proto =check_proto (entry);parse_multi_ports (argv[optind-1 ], minfo, proto); minfo->flags =IPT_MPORT_DESTINATION ; - *nfcache |=NFC_IP_DST_PT ;break ;case '3' :
@@ -156,7 +154,6 @@ proto =check_proto (entry);parse_multi_ports (argv[optind-1 ], minfo, proto); minfo->flags =IPT_MPORT_EITHER ; - *nfcache |=NFC_IP_SRC_PT |NFC_IP_DST_PT ;break ;default :
libip6t_REJECT.c +0 -2
@@ -79,8 +79,6 @@/* default */ reject->with =IP6T_ICMP6_PORT_UNREACH ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }/* Function which parses command options; returns true if it
libipt_NETLINK.c +0 -1
@@ -32,7 +32,6 @@ nld->flags=0 ; - *nfcache |=NFC_UNKNOWN ; }/* Parse command options */
libipt_sctp.c +0 -2
@@ -293,7 +293,6 @@if (invert) einfo->invflags |=IPT_SCTP_SRC_PORTS ; *flags |=IPT_SCTP_SRC_PORTS ; - *nfcache |=NFC_IP_SRC_PT ;break ;case '2' :
@@ -306,7 +305,6 @@if (invert) einfo->invflags |=IPT_SCTP_DEST_PORTS ; *flags |=IPT_SCTP_DEST_PORTS ; - *nfcache |=NFC_IP_DST_PT ;break ;case '3' :
libipt_u32.c +0 -8
@@ -37,13 +37,6 @@ { 0 } }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} -/* shared printing code */ static void print_u32 (struct ipt_u32 *data) {
@@ -257,7 +250,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_u32)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_u32)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_condition.c +0 -9
@@ -24,14 +24,6 @@ { .name = 0 } }; - -static void -init (struct ip6t_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} - - static int parse(int c, char **argv, int invert, unsigned int *flags, const struct ip6t_entry *entry, unsigned int *nfcache,
@@ -99,7 +91,6 @@ .size = IP6T_ALIGN(sizeof(struct condition6_info)), .userspacesize = IP6T_ALIGN(sizeof(struct condition6_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_eui64.c +0 -9
@@ -26,14 +26,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ip6t_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int
@@ -71,7 +63,6 @@ .size = IP6T_ALIGN(sizeof(int)), .userspacesize = IP6T_ALIGN(sizeof(int)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_record_rpc.c +12 -21
@@ -16,14 +16,6 @@ {0} }; -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this. */ - *nfcache |=NFC_UNKNOWN ; -} - -/* Function which parses command options; returns true if it ate an option */ static int
@@ -53,19 +45,18 @@ }static -struct iptables_match record_rpc -= {NULL , -"record_rpc" , -IPTABLES_VERSION , -IPT_ALIGN (0 ), -IPT_ALIGN (0 ), - &help, - &init, - &parse, - &final_check, - &print, - &save, - opts +struct iptables_match record_rpc = { + .next =NULL , + .name ="record_rpc" , + .version =IPTABLES_VERSION , + .size =IPT_ALIGN (0 ), + .userspacesize =IPT_ALIGN (0 ), + .help = &help, + .parse = &parse, + .final_check = &final_check, + .print = &print, + .save = &save, + .extra_opts = opts };void _init (void )
libipt_rpc.c +0 -2
@@ -180,8 +180,6 @@struct ipt_rpc_info *rpcinfo = ((struct ipt_rpc_info *)match->data); -/* caching not yet implemented */ - *nfcache |=NFC_UNKNOWN ;/* initialise those funky user vars */ rpcinfo->i_procs =-1 ;
libipt_SAME.c +0 -2
@@ -43,8 +43,6 @@ mr->info =0 ; mr->ipnum =0 ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }/* Parses range of IPs */
libipt_condition.c +0 -9
@@ -24,14 +24,6 @@ { .name = 0 } }; - -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} - - static int parse(int c, char **argv, int invert, unsigned int *flags, const struct ipt_entry *entry, unsigned int *nfcache,
@@ -99,7 +91,6 @@ .size = IPT_ALIGN(sizeof(struct condition_info)), .userspacesize = IPT_ALIGN(sizeof(struct condition_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_icmp.c +3 -8
@@ -114,7 +114,7 @@ {0} }; -static unsigned int +static void parse_icmp (const char *icmptype,u_int8_t *type,u_int8_t code[]) {unsigned int limit =sizeof (icmp_codes)/sizeof (struct icmp_names );
@@ -165,10 +165,6 @@ code[1 ] =0xFF ; } } - -if (code[0 ] ==0 && code[1 ] ==0xFF ) -return NFC_IP_SRC_PT ; -else return NFC_IP_SRC_PT |NFC_IP_DST_PT ; }/* Initialize the match. */
@@ -194,9 +190,8 @@switch (c) {case '1' :check_inverse (optarg, &invert, &optind,0 ); - *nfcache |=parse_icmp (argv[optind-1 ], - &icmpinfo->type, - icmpinfo->code); +parse_icmp (argv[optind-1 ], &icmpinfo->type, + icmpinfo->code);if (invert) icmpinfo->invflags |=IPT_ICMP_INV ;break ;
libipt_quota.c +0 -9
@@ -24,14 +24,6 @@ " --quota quota quota (bytes)\n" "\n"); } -/* initialise match */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* no can cache */ - *nfcache |=NFC_UNKNOWN ; -} -/* print matchinfo */ static void const struct ipt_ip *ip,const struct ipt_entry_match *match,int numeric)
@@ -100,7 +92,6 @@ .size = IPT_ALIGN(sizeof (struct ipt_quota_info)), .userspacesize = IPT_ALIGN(sizeof (struct ipt_quota_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_string.c +0 -10
@@ -44,16 +44,7 @@ { .name = 0 } }; - -/* Initialize the match. */ static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} - - -static void parse_string (const unsigned char *s,struct ipt_string_info *info) {if (strlen (s) <=BM_MAX_NLEN )strcpy (info->string, s);
@@ -279,7 +270,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_string_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_string_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_ULOG.c +0 -2
@@ -60,8 +60,6 @@ loginfo->nl_group =ULOG_DEFAULT_NLGROUP ; loginfo->qthreshold =ULOG_DEFAULT_QTHRESHOLD ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }#define IPT_LOG_OPT_NLGROUP 0x01
libip6t_ipv6header.c +0 -2
@@ -162,8 +162,6 @@ info->matchflags =0x00 ; info->invflags =0x00 ; info->modeflag =0x00 ; -/* No caching (yet) */ - *nfcache |=NFC_UNKNOWN ; } static unsigned int
libip6t_hl.c +0 -7
@@ -25,12 +25,6 @@ , IPTABLES_VERSION); } -static void init (struct ip6t_entry_match *m,unsigned int *nfcache) -{ -/* caching not yet implemented */ - *nfcache |=NFC_UNKNOWN ; -} -static int parse (int c,char **argv,int invert,unsigned int *flags,const struct ip6t_entry *entry,unsigned int *nfcache,struct ip6t_entry_match **match)
@@ -141,7 +135,6 @@ .size = IP6T_ALIGN(sizeof(struct ip6t_hl_info)), .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_hl_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_dscp.c +0 -6
@@ -24,11 +24,6 @@/* This is evil, but it's my code - HW*/ #include "libipt_dscp_helper.c" -static void init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_IP_TOS ; -} -static void help (void ) { printf(
@@ -164,7 +159,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_dscp_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_dscp_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_mark.c +0 -9
@@ -25,14 +25,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this. */ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int
@@ -138,7 +130,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_mark_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_mark_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_icmpv6.c +3 -8
@@ -90,7 +90,7 @@ {0} }; -static unsigned int +static void parse_icmpv6 (const char *icmpv6type,u_int8_t *type,u_int8_t code[]) {unsigned int limit =sizeof (icmpv6_codes)/sizeof (struct icmpv6_names );
@@ -141,10 +141,6 @@ code[1 ] =0xFF ; } } - -if (code[0 ] ==0 && code[1 ] ==0xFF ) -return NFC_IP6_SRC_PT ; -else return NFC_IP6_SRC_PT |NFC_IP6_DST_PT ; }/* Initialize the match. */
@@ -169,9 +165,8 @@switch (c) {case '1' :check_inverse (optarg, &invert, &optind,0 ); - *nfcache |=parse_icmpv6 (argv[optind-1 ], - &icmpv6info->type, - icmpv6info->code); +parse_icmpv6 (argv[optind-1 ], &icmpv6info->type, + icmpv6info->code);if (invert) icmpv6info->invflags |=IP6T_ICMP_INV ;break ;
libipt_time.c +0 -2
@@ -57,8 +57,6 @@ {struct ipt_time_info *info = (struct ipt_time_info *)m->data; globaldays =0 ; -/* caching not yet implemented */ - *nfcache |=NFC_UNKNOWN ;/* By default, we match on everyday */ info->days_match =127 ;/* By default, we match on every hour:min of the day */
libipt_ipv4options.c +0 -9
@@ -35,14 +35,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* caching not yet implemented */ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int
@@ -306,7 +298,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_ipv4options_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_ipv4options_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_comment.c +0 -8
@@ -29,14 +29,7 @@ {0} }; -/* Initialize the match. */ static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} - -static void parse_comment (const unsigned char *s,struct ipt_comment_info *info) {int slen =strlen (s);
@@ -113,7 +106,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_comment_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_comment_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_pool.c +0 -2
@@ -43,8 +43,6 @@ info->src =IP_POOL_NONE ; info->dst =IP_POOL_NONE ; info->flags =0 ; -/* Can't cache this - XXX */ - *nfcache |=NFC_UNKNOWN ; }/* Function which parses command options; returns true if it ate an option */
libipt_REJECT.c +0 -2
@@ -94,8 +94,6 @@/* default */ reject->with =IPT_ICMP_PORT_UNREACHABLE ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }/* Function which parses command options; returns true if it
libipt_helper.c +0 -9
@@ -24,14 +24,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this. */ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int
@@ -96,7 +88,6 @@ .version = IPTABLES_VERSION, .size = IPT_ALIGN(sizeof(struct ipt_helper_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_nth.c +0 -8
@@ -50,13 +50,6 @@ { 0 } }; -/* Initialize the target. */ -static void -init (struct ip6t_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} -#define IP6T_NTH_OPT_EVERY 0x01#define IP6T_NTH_OPT_NOT_EVERY 0x02#define IP6T_NTH_OPT_START 0x04
@@ -223,7 +216,6 @@ .size = IP6T_ALIGN(sizeof(struct ip6t_nth_info)), .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_nth_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_LOG.c +0 -2
@@ -50,8 +50,6 @@ loginfo->level =LOG_DEFAULT_LEVEL ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }struct ipt_log_names {
libipt_NETMAP.c +0 -2
@@ -63,8 +63,6 @@/* Actually, it's 0, but it's ignored at the moment. */ mr->rangesize =1 ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }/* Parses network address */
libipt_BALANCE.c +0 -2
@@ -35,8 +35,6 @@/* Actually, it's 0, but it's ignored at the moment. */ mr->rangesize =1 ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }/* Parses range of IPs */
libip6t_mac.c +0 -9
@@ -28,15 +28,7 @@ {0} }; -/* Initialize the match. */ static void -init (struct ip6t_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} - -static void parse_mac (const char *mac,struct ip6t_mac_info *info) {unsigned int i =0 ;
@@ -134,7 +126,6 @@ .size = IP6T_ALIGN(sizeof(struct ip6t_mac_info)), .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_mac_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_udp.c +0 -2
@@ -109,7 +109,6 @@if (invert) udpinfo->invflags |=IPT_UDP_INV_SRCPT ; *flags |=UDP_SRC_PORTS ; - *nfcache |=NFC_IP_SRC_PT ;break ;case '2' :
@@ -121,7 +120,6 @@if (invert) udpinfo->invflags |=IPT_UDP_INV_DSTPT ; *flags |=UDP_DST_PORTS ; - *nfcache |=NFC_IP_DST_PT ;break ;default :
libipt_SET.c +0 -2
@@ -51,8 +51,6 @@ info->add_set.index = info->del_set.index =IP_SET_INVALID_ID ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; } static void
libip6t_limit.c +0 -2
@@ -81,8 +81,6 @@parse_rate (IP6T_LIMIT_AVG , &r->avg); r->burst =IP6T_LIMIT_BURST ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }/* FIXME: handle overflow:
libipt_ecn.c +0 -6
@@ -16,11 +16,6 @@#include <linux/netfilter_ipv4/ip_tables.h> #include <linux/netfilter_ipv4/ipt_ecn.h> -static void init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_IP_TOS ; -} -static void help (void ) { printf(
@@ -163,7 +158,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_ecn_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_ecn_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libip6t_length.c +0 -8
@@ -26,13 +26,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ip6t_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} -static u_int16_t parse_length (const char *s) {
@@ -146,7 +139,6 @@ .size = IP6T_ALIGN(sizeof(struct ip6t_length_info)), .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_length_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_limit.c +0 -2
@@ -81,8 +81,6 @@parse_rate (IPT_LIMIT_AVG , &r->avg); r->burst =IPT_LIMIT_BURST ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }/* FIXME: handle overflow:
libip6t_mark.c +0 -9
@@ -25,14 +25,6 @@ {0} }; -/* Initialize the match. */ -static void -init (struct ip6t_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this. */ - *nfcache |=NFC_UNKNOWN ; -} -/* Function which parses command options; returns true if it ate an option */ static int
@@ -137,7 +129,6 @@ .size = IP6T_ALIGN(sizeof(struct ip6t_mark_info)), .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_mark_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_iprange.c +0 -9
@@ -26,15 +26,7 @@ {0} }; -/* Initialize the match. */ static void -init (struct ipt_entry_match *m,unsigned int *nfcache) -{ -/* Can't cache this. */ - *nfcache |=NFC_UNKNOWN ; -} - -static void parse_iprange (char *arg,struct ipt_iprange *range) {char *dash;
@@ -180,7 +172,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_iprange_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_iprange_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_tcp.c +0 -5
@@ -187,7 +187,6 @@if (invert) tcpinfo->invflags |=IPT_TCP_INV_SRCPT ; *flags |=TCP_SRC_PORTS ; - *nfcache |=NFC_IP_SRC_PT ;break ;case '2' :
@@ -199,7 +198,6 @@if (invert) tcpinfo->invflags |=IPT_TCP_INV_DSTPT ; *flags |=TCP_DST_PORTS ; - *nfcache |=NFC_IP_DST_PT ;break ;case '3' :
@@ -209,7 +207,6 @@ " allowed");parse_tcp_flags (tcpinfo,"SYN,RST,ACK" ,"SYN" , invert); *flags |=TCP_FLAGS ; - *nfcache |=NFC_IP_TCPFLAGS ;break ;case '4' :
@@ -228,7 +225,6 @@ invert); optind++; *flags |=TCP_FLAGS ; - *nfcache |=NFC_IP_TCPFLAGS ;break ;case '5' :
@@ -240,7 +236,6 @@if (invert) tcpinfo->invflags |=IPT_TCP_INV_OPTION ; *flags |=TCP_OPTION ; - *nfcache |=NFC_IP_PROTO_UNKNOWN ;break ;default :
libipt_DNAT.c +0 -9
@@ -33,14 +33,6 @@ { 0 } }; -/* Initialize the target. */ -static void -init (struct ipt_entry_target *t,unsigned int *nfcache) -{ -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; -} -static struct ipt_natinfo *append_range (struct ipt_natinfo *info,const struct ip_nat_range *range) {
@@ -236,7 +228,6 @@ .size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)), .userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
libipt_psd.c +0 -2
@@ -56,8 +56,6 @@ psdinfo->delay_threshold =SCAN_DELAY_THRESHOLD ; psdinfo->lo_ports_weight =PORT_WEIGHT_PRIV ; psdinfo->hi_ports_weight =PORT_WEIGHT_HIGH ; -/* Can't cache this */ - *nfcache |=NFC_UNKNOWN ; }
libipt_osf.c +0 -8
@@ -54,13 +54,6 @@ { .name = 0 } }; - -static void init (struct ipt_entry_match *m,unsigned int *nfcache) -{ - *nfcache |=NFC_UNKNOWN ; -} - -static void parse_string (const unsigned char *s,struct ipt_osf_info *info) {if (strlen (s) <MAXGENRELEN )
@@ -142,7 +135,6 @@ .size = IPT_ALIGN(sizeof(struct ipt_osf_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_osf_info)), .help = &help, - .init = &init, .parse = &parse, .final_check = &final_check, .print = &print,
ip6tables.c +0 -5
@@ -1887,7 +1887,6 @@ && (fw.ipv6.invflags & IP6T_INV_PROTO))exit_error (PARAMETER_PROBLEM ,"rule would never match protocol" ); - fw.nfcache |=NFC_IP6_PROTO ;break ;case 's' :
@@ -1895,7 +1894,6 @@set_option (&options,OPT_SOURCE , &fw.ipv6.invflags, invert); shostnetworkmask = argv[optind-1 ]; - fw.nfcache |=NFC_IP6_SRC ;break ;case 'd' :
@@ -1903,7 +1901,6 @@set_option (&options,OPT_DESTINATION , &fw.ipv6.invflags, invert); dhostnetworkmask = argv[optind-1 ]; - fw.nfcache |=NFC_IP6_DST ;break ;case 'j' :
@@ -1935,7 +1932,6 @@parse_interface (argv[optind-1 ], fw.ipv6.iniface, fw.ipv6.iniface_mask); - fw.nfcache |=NFC_IP6_IF_IN ;break ;case 'o' :
@@ -1945,7 +1941,6 @@parse_interface (argv[optind-1 ], fw.ipv6.outiface, fw.ipv6.outiface_mask); - fw.nfcache |=NFC_IP6_IF_OUT ;break ;case 'v' :
Re: [PATCH] kill NFC_* stuff in iptables [was Re: iptables compile error: NFC_IP_TOS undeclared]
Quoted 8 lines · Pablo Neira
Quoted 4 lines · Patrick McHardy
I haven't actually checked
the API, but can't we remove all those now empty init functions ? If not I think it would be nicer to change the API to check for ->init == NULL instead of leaving all these empty funtion bodies around.Yes, I agree and I did it, I must confess that it was kinda boring a bit. See the patch attached.
Thanks Pablo. I'm going to apply it once iptables 1.3.0 is released.
Quoted 4 lines
Quoted 2 lines
I don't think we can remove it from struct
ipt_entrywithout breaking userspace compatibility. But we could stop using it.Yes, I was aware of that :). I didn't talk about modifying
ipt_entrywhich is not possible because of backward compatibility. I mean that, as next step, we could kill those nfcache arguments passed as parameter that aren't useful anymore.
Sure, go ahead.
Regards
Patrick
Quoted 5 lines · Samuel Jean
On Thu, February 10, 2005 9:07 am, Jonas Berlin said:
Hi Jonas!
Hello Samuel!
Quoted 9 lines
Quoted 8 lines
ip6tables ... -j
CLASSIFY_v6--set-class 1:20Although this works fine, having some modules with suffix
_v6and some not is just plain confusing. Is there any way to reuse the CLASSIFY for ipv6 name without conflicting with the CLASSIFY module already in pom? Maybe I missed something?
Quoted 5 lines
You have to create an ipv6 directory into the CLASSIFY in pom.
CLASSIFY/linux/net/ipv6/netfilter/ip6t_CLASSIFY.c
Yeah that would be nice, but I think there is a problem: the newest kernels already have the ipv4 version included, and so patch-o-matic would either consider CLASSIFY already installed and skip it or then it would probably complain while installing that it there were some conflicts with the files. I haven't tested though, but I wouldn't assume it has the logic to pick out the ipv6-specific parts from the directory..
Quoted 4 lines
Also, just register your target against
ip6_tableswith the same name as CLASSIFY would do withip_tables. There's no conflict in that way.
Yeah, it does work fine as CLASSIFY_v6..
Quoted 3 lines
All of this is a AFAIK.
Same here :D
Quoted 4 lines
Thanks for your effort,
Samuel
Thanks for the reply.. I haven't got any others yet.
Signature · 1 line
- xkr47
Quoted 3 lines · Jonas Berlin
Quoted 1 line · Jonas Berlin
3. If I succeed porting something, what should I name the patch to be sent to patch-o-matic-ng? I don't think I could just extend the existing ones as that would suggest the original authors have something to do with it and also some of them also are pending or already included in the ekernel. So, would
CLASSIFY_v6be an acceptable name for the ipv6 version of CLASSIFY?
[...]
Quoted 1 line
since the name of the name of the module essentially determines the name of the target, the module etc.
why?
the module in patch-o-matic-ng (the top directory name) could be named CLASSIFY_v6, containing the target CLASSIFY for ipv6, with the kernel module named ip6t_CLASSIFY. I see nothing which prevents this.
c'ya
sven
Signature · 2 lines
The Internet treats censorship as a routing problem, and routes around it. (John Gilmore on http://www.cygnus.com/~gnu/)
Quoted 5 lines · Sven-Haegar Koch
Quoted 1 line
since the name of the name of the module essentially determines the name of the target, the module etc.
why?
the module in patch-o-matic-ng (the top directory name) could be namedCLASSIFY_v6, containing the target CLASSIFY for ipv6, with the kernel module namedip6t_CLASSIFY. I see nothing which prevents this.
Oh! You're right, it worked. I must have had something wrong somewhere before when it complained. Excellent! :)
Quoted 2 lines
c'ya
sven
Thanks,
Signature · 1 line
- xkr47
A message that is not in the archive (sent off-list or not yet received): [email protected]
ULOG target for ipv6
Quoted 3 lines · Martijn Lievaart
What I mostly miss in ipv6 support is conntrack and ULOG.
Here's my first attempt of ULOG for ipv6. It's _untested_, but it compiles at least on 2.6 and it patches fine against 2.4.28 also.
As a side note - I have no idea how a (the) userspace daemon will react to getting ipv6 packets. :)
Feel free to send me any problems you encounter with the kernel module or iptables extension though.
Good luck :)
--------
Someone could also point me to the latest instructions on how to contribute - the online docs I found here didn't work very well:
http://netfilter.org/documentation/HOWTO//netfilter-extensions-HOWTO-9.html
Signature · 1 line
- xkr47
netfilter question
Hello guys. I'll try to make it as short an simple as I can.
I want to develop a kernel module which will be running in two linux hosts, connected by a crossover network cable (ethernet). This kernel module will intercept a specific type of traffic (as an example, let's say FTP packets (encapsulated in DIX frames)), both incomming and outgoing, and change the ethertype in the frame header.
Outgoing dix frames carrying FTP packets get their ethertype changed to a private, non standard ethertype number, just before they leave the host (i.e. before they are passed to the network driver). The frame is intercepted with the NF_IP_POST_ROUTING hook.
Incoming dix frames carrying FTP packets are get their ethertype changed (at this point, a non standard ethertype number) to the standard IPv4 ethertype number (i.e. 0x800), just after they are processed by the network driver. The frame is intercepted with the NF_IP_PRE_ROUTING hook.
My doubt is:
I'm not sure if I will be able to intercept the incoming frames because they have a non standard ethertype number. They might get dropped before passing through the NF_IP_PRE_ROUTING hook, due to the unrecognized ethertype number. Is this true or false?
If the frame passes the hook before trying to identify the packet type, then I'll have no trouble, because my netfilter module changes the frame to the original ethertype number, thus making the hole process transparent to the TCP/IP stacks running in both hosts.
I could explain what the hell I need to this for, but then you would have three times more text to read :P I tried to restrict this post to a minimum-painless-size.
Regards,
-Pedro Fortuna
Re: ULOG target for ipv6
In reply to Jonas BerlinQuoted 2 lines · Jonas Berlin
Here's my first attempt of ULOG for ipv6. It's _untested_, but it compiles at least on 2.6 and it patches fine against 2.4.28 also.
;) I've merged it into pom-ng (Rev. 3694). I'm not quite happy about ulogd from userspace having no idea whether the packet came from the ipv4 or ipv6 stack - but I think it's fine for now.
Quoted 2 lines
Someone could also point me to the latest instructions on how to contribute - the online docs I found here didn't work very well:
Well, there are no instructions. Patches to the HOWTO's or new documentation is always welcome.
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Re: ULOG target for ipv6
Quoted 5 lines · Harald Welte
;) I've merged it into pom-ng (Rev. 3694). I'm not quite happy about ulogd from userspace having no idea whether the packet came from the ipv4 or ipv6 stack - but I think it's fine for now.
Nice :)
I actually meant that ulogd probably isn't expecting ipv6 packets (since there was no ipv6 support before) and I thus don't know what ulogd will do when it gets one.
Ulogd can figure out which stack the packet came from simply by looking at the it (check if it contains an ipv4 or ipv6 header). Or at least that's how I think it should work :)
Quoted 4 lines
Well, there are no instructions. Patches to the HOWTO's or new documentation is always welcome.
Sure.. I found README.newpatches in pom-ng which helped creating the patch but did not mention how to submit.. Is the proper way to send a message to netfilter-devel with a subject starting with [ANNOUNCE] or [PATCH] or something like that? And any wishes/requirements regarding the message content of the announcement?
Signature · 1 line
- xkr47