: Netfilter update
Subsystems (4)
cover : Netfilter update
Hi Dave,
following is another netfilter update. The diffstat contains mostly noise from a MODULE_DESCRIPTION update, the main changes are:
- removal of EXPERIMENTAL dependencies for all but a few selected modules
- Updates from Jan for multiple matches and targets to use fixed types, scheduling of the old version for removal in 2009
- IPv6 support for a few more matches and targets
- SCTP conntrack cleanup
- REJECT target conversion to construct TCP RSTs from scratch to properly deal with IP options
- Minor cleanups and optimizations
Please apply, thanks.
Documentation/feature-removal-schedule.txt | 32 ++ include/linux/netfilter.h | 4 + include/linux/netfilter/Kbuild | 1 + include/linux/netfilter/nf_conntrack_sctp.h | 1 - include/linux/netfilter/xt_CONNMARK.h | 5 + include/linux/netfilter/xt_MARK.h | 4 + include/linux/netfilter/xt_RATEEST.h | 2 + include/linux/netfilter/xt_connlimit.h | 2 +- include/linux/netfilter/xt_connmark.h | 5 + include/linux/netfilter/xt_conntrack.h | 16 +- include/linux/netfilter/xt_hashlimit.h | 2 +- include/linux/netfilter/xt_iprange.h | 17 + include/linux/netfilter/xt_mark.h | 5 + include/linux/netfilter/xt_policy.h | 23 ++- include/linux/netfilter/xt_quota.h | 2 + include/linux/netfilter/xt_rateest.h | 2 + include/linux/netfilter/xt_statistic.h | 1 + include/linux/netfilter/xt_string.h | 2 + include/linux/netfilter_ipv4/ipt_CLUSTERIP.h | 1 + include/linux/netfilter_ipv4/ipt_iprange.h | 6 +- include/net/netfilter/nf_conntrack.h | 7 - include/net/netfilter/nf_conntrack_core.h | 12 - include/net/netfilter/nf_conntrack_helper.h | 4 + include/net/netfilter/nf_conntrack_l3proto.h | 3 - net/ipv4/netfilter.c | 10 + net/ipv4/netfilter/Kconfig | 14 +- net/ipv4/netfilter/Makefile | 1 - net/ipv4/netfilter/ip_tables.c | 47 ++-- net/ipv4/netfilter/ipt_CLUSTERIP.c | 2 +- net/ipv4/netfilter/ipt_ECN.c | 2 +- net/ipv4/netfilter/ipt_LOG.c | 2 +- net/ipv4/netfilter/ipt_MASQUERADE.c | 2 +- net/ipv4/netfilter/ipt_NETMAP.c | 2 +- net/ipv4/netfilter/ipt_REDIRECT.c | 2 +- net/ipv4/netfilter/ipt_REJECT.c | 104 +++---- net/ipv4/netfilter/ipt_TOS.c | 82 ----- net/ipv4/netfilter/ipt_TTL.c | 2 +- net/ipv4/netfilter/ipt_ULOG.c | 2 +- net/ipv4/netfilter/ipt_addrtype.c | 2 +- net/ipv4/netfilter/ipt_ah.c | 2 +- net/ipv4/netfilter/ipt_ecn.c | 2 +- net/ipv4/netfilter/ipt_iprange.c | 77 ----- net/ipv4/netfilter/ipt_recent.c | 2 +- net/ipv4/netfilter/ipt_ttl.c | 2 +- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 7 - .../netfilter/nf_conntrack_l3proto_ipv4_compat.c | 5 +- net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 8 - net/ipv6/netfilter/Kconfig | 12 +- net/ipv6/netfilter/ip6_tables.c | 42 ++-- net/ipv6/netfilter/ip6t_HL.c | 2 +- net/ipv6/netfilter/ip6t_LOG.c | 2 +- net/ipv6/netfilter/ip6t_REJECT.c | 2 +- net/ipv6/netfilter/ip6t_ah.c | 2 +- net/ipv6/netfilter/ip6t_eui64.c | 2 +- net/ipv6/netfilter/ip6t_frag.c | 2 +- net/ipv6/netfilter/ip6t_hbh.c | 2 +- net/ipv6/netfilter/ip6t_hl.c | 2 +- net/ipv6/netfilter/ip6t_ipv6header.c | 2 +- net/ipv6/netfilter/ip6t_mh.c | 2 +- net/ipv6/netfilter/ip6t_rt.c | 2 +- net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | 7 - net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 8 - net/netfilter/Kconfig | 37 ++- net/netfilter/Makefile | 2 +- net/netfilter/core.c | 9 + net/netfilter/nf_conntrack_core.c | 5 +- net/netfilter/nf_conntrack_l3proto_generic.c | 7 - net/netfilter/nf_conntrack_proto_generic.c | 8 - net/netfilter/nf_conntrack_proto_sctp.c | 310 ++++++++++---------- net/netfilter/nf_conntrack_proto_tcp.c | 69 ++--- net/netfilter/nf_conntrack_proto_udp.c | 9 - net/netfilter/nf_conntrack_proto_udplite.c | 9 - net/netfilter/nf_conntrack_standalone.c | 5 +- net/netfilter/nf_sysctl.c | 25 -- net/netfilter/xt_CLASSIFY.c | 2 +- net/netfilter/xt_CONNMARK.c | 119 ++++++-- net/netfilter/xt_CONNSECMARK.c | 2 +- net/netfilter/xt_DSCP.c | 8 +- net/netfilter/xt_MARK.c | 76 ++++-- net/netfilter/xt_NFLOG.c | 2 +- net/netfilter/xt_NFQUEUE.c | 2 +- net/netfilter/xt_NOTRACK.c | 1 + net/netfilter/xt_RATEEST.c | 2 +- net/netfilter/xt_SECMARK.c | 2 +- net/netfilter/xt_TCPMSS.c | 2 +- net/netfilter/xt_TCPOPTSTRIP.c | 2 +- net/netfilter/xt_TRACE.c | 1 + net/netfilter/xt_comment.c | 2 +- net/netfilter/xt_connbytes.c | 2 +- net/netfilter/xt_connlimit.c | 2 +- net/netfilter/xt_connmark.c | 90 +++++-- net/netfilter/xt_conntrack.c | 209 ++++++++++++-- net/netfilter/xt_dccp.c | 2 +- net/netfilter/xt_dscp.c | 2 +- net/netfilter/xt_esp.c | 2 +- net/netfilter/xt_hashlimit.c | 2 +- net/netfilter/xt_helper.c | 2 +- net/netfilter/xt_iprange.c | 180 ++++++++++++ net/netfilter/xt_length.c | 2 +- net/netfilter/xt_limit.c | 2 +- net/netfilter/xt_mac.c | 2 +- net/netfilter/xt_mark.c | 74 ++++-- net/netfilter/xt_multiport.c | 2 +- net/netfilter/xt_owner.c | 2 +- net/netfilter/xt_physdev.c | 2 +- net/netfilter/xt_pkttype.c | 19 +- net/netfilter/xt_policy.c | 17 +- net/netfilter/xt_quota.c | 1 + net/netfilter/xt_realm.c | 2 +- net/netfilter/xt_sctp.c | 2 +- net/netfilter/xt_statistic.c | 2 +- net/netfilter/xt_string.c | 2 +- net/netfilter/xt_tcpmss.c | 2 +- net/netfilter/xt_tcpudp.c | 2 +- net/netfilter/xt_time.c | 2 +- net/netfilter/xt_u32.c | 2 +- 116 files changed, 1168 insertions(+), 813 deletions(-) create mode 100644 include/linux/netfilter/xt_iprange.h delete mode 100644 net/ipv4/netfilter/ipt_TOS.c delete mode 100644 net/ipv4/netfilter/ipt_iprange.c delete mode 100644 net/netfilter/nf_sysctl.c create mode 100644 net/netfilter/xt_iprange.c
Denys Vlasenko (1):
[NETFILTER]: {ip,ip6}_tables: remove some inlines
Jan Engelhardt (17):
[NETFILTER]: remove ipt_TOS.c
[NETFILTER]: xt_TOS: Change semantic of mask value [NETFILTER]: xt_TOS: Properly set the TOS field [NETFILTER]: Annotate start of kernel fields in NF headers [NETFILTER]: xt_CONNMARK target, revision 1 [NETFILTER]: xt_MARK target, revision 2 [NETFILTER]: xt_connmark match, revision 1 [NETFILTER]: Extend nf_inet_addr with in{,6}_addr [NETFILTER]: xt_conntrack match, revision 1 [NETFILTER]: xt_mark match, revision 1 [NETFILTER]: xt_pkttype: Add explicit check for IPv4 [NETFILTER]: xt_pkttype: IPv6 multicast address recognition [NETFILTER]: xt_policy: use the new union nf_inet_addr [NETFILTER]: Update modules' descriptions [NETFILTER]: Rename ipt_iprange to xt_iprange [NETFILTER]: xt_iprange match, revision 1 [NETFILTER]: Update feature-removal-schedule.txt
Patrick McHardy (20):
[NETFILTER]: Hide a few more options under NETFILTER_ADVANCED [NETFILTER]: Remove some EXPERIMENTAL dependencies
[NETFILTER]: ipt_REJECT: properly handle IP options
[NETFILTER]: nf_conntrack_{tcp,sctp}: mark state table const [NETFILTER]: nf_conntrack_{tcp,sctp}: shrink state table [NETFILTER]: nf_conntrack_tcp: remove timeout indirection [NETFILTER]: nf_conntrack_sctp: basic cleanups
[NETFILTER]: nf_conntrack_sctp: use proper types for bitops [NETFILTER]: nf_conntrack_sctp: reduce line length
[NETFILTER]: nf_conntrack_sctp: reduce line length further [NETFILTER]: nf_conntrack_sctp: consolidate sctp_packet() error paths [NETFILTER]: nf_conntrack_sctp: rename "newconntrack" variable [NETFILTER]: nf_conntrack_sctp: don't take sctp_lock once per chunk [NETFILTER]: nf_conntrack_sctp: remove unused ttag field from conntrack data [NETFILTER]: nf_conntrack_sctp: replace magic value by symbolic constant [NETFILTER]: nf_conntrack_sctp: remove timeout indirection [NETFILTER]: kill nf_sysctl.c
[NETFILTER]: nf_conntrack: clean up a few header files [NETFILTER]: nf_conntrack: remove print_conntrack function from l3protos [NETFILTER]: nf_conntrack: make print_conntrack function optional for l4protos
PATCH 1/38 : Hide a few more options under NETFILTER_ADVANCED
[NETFILTER]: Hide a few more options under NETFILTER_ADVANCED
---
commit 46cc0c9011901f2697608a11c05d43765c7a3b38
tree 65a6a7d661d466e1f5fcc5a43836a24361327e50
parent ee28d55dcb195190fb8bbef5cc8f65b21fd78b52
author Patrick McHardy <[email protected]> Mon, 14 Jan 2008 06:51:07 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:21 +0100
net/netfilter/Kconfig | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
net/netfilter/Kconfig +2 -0
@@ -378,6 +378,7 @@ config NETFILTER_XT_TARGET_NOTRACK config NETFILTER_XT_TARGET_RATEEST tristate '"RATEEST" target support' depends on NETFILTER_XTABLES + depends on NETFILTER_ADVANCED help This option adds a `RATEEST' target, which allows to measure rates similar to TC estimators. The `rateest' match can be
@@ -676,6 +677,7 @@ config NETFILTER_XT_MATCH_QUOTA config NETFILTER_XT_MATCH_RATEEST tristate '"rateest" match support' depends on NETFILTER_XTABLES + depends on NETFILTER_ADVANCED select NETFILTER_XT_TARGET_RATEEST help This option adds a `rateest' match, which allows to match on the
PATCH 2/38 : Remove some EXPERIMENTAL dependencies
In reply to Patrick McHardy[NETFILTER]: Remove some EXPERIMENTAL dependencies
Most of the netfilter modules are not considered experimental anymore, the only ones I want to keep marked as EXPERIMENTAL are:
- TCPOPTSTRIP target, which is brand new.
- SANE helper, which is quite new.
- CLUSTERIP target, which I believe hasn't had much testing despite being in the kernel for quite a long time.
- SCTP match and conntrack protocol, which are a mess and need to be reviewed and cleaned up before I would trust them.
---
commit 9eef50d726e834652abc7aca9740b62fbb89c124
tree 21abe009ce0e5e64be41a6a4c307fc7b30db0f08
parent 46cc0c9011901f2697608a11c05d43765c7a3b38
author Patrick McHardy <[email protected]> Mon, 14 Jan 2008 06:51:08 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:22 +0100
net/ipv4/netfilter/Kconfig | 4 ++-- net/ipv6/netfilter/Kconfig | 12 ++++++------ net/netfilter/Kconfig | 24 ++++++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-)
net/ipv4/netfilter/Kconfig +2 -2
@@ -229,8 +229,8 @@ config IP_NF_TARGET_NETMAP To compile it as a module, choose M here. If unsure, say N. config NF_NAT_SNMP_BASIC - tristate "Basic SNMP-ALG support (EXPERIMENTAL)" - depends on EXPERIMENTAL && NF_NAT + tristate "Basic SNMP-ALG support" + depends on NF_NAT depends on NETFILTER_ADVANCED ---help---
net/ipv6/netfilter/Kconfig +6 -6
@@ -2,12 +2,12 @@ # IP netfilter configuration # -menu "IPv6: Netfilter Configuration (EXPERIMENTAL)" - depends on INET && IPV6 && NETFILTER && EXPERIMENTAL +menu "IPv6: Netfilter Configuration" + depends on INET && IPV6 && NETFILTER config NF_CONNTRACK_IPV6 - tristate "IPv6 connection tracking support (EXPERIMENTAL)" - depends on INET && IPV6 && EXPERIMENTAL && NF_CONNTRACK + tristate "IPv6 connection tracking support" + depends on INET && IPV6 && NF_CONNTRACK default m if NETFILTER_ADVANCED=n ---help--- Connection tracking keeps a record of what packets have passed
@@ -22,7 +22,7 @@ config NF_CONNTRACK_IPV6 config IP6_NF_QUEUE tristate "IP6 Userspace queueing via NETLINK (OBSOLETE)" - depends on INET && IPV6 && NETFILTER && EXPERIMENTAL + depends on INET && IPV6 && NETFILTER depends on NETFILTER_ADVANCED ---help---
@@ -44,7 +44,7 @@ config IP6_NF_QUEUE config IP6_NF_IPTABLES tristate "IP6 tables support (required for filtering)" - depends on INET && IPV6 && EXPERIMENTAL + depends on INET && IPV6 select NETFILTER_XTABLES default m if NETFILTER_ADVANCED=n help
net/netfilter/Kconfig +12 -12
@@ -76,8 +76,8 @@ config NF_CONNTRACK_SECMARK If unsure, say 'N'. config NF_CONNTRACK_EVENTS - bool "Connection tracking events (EXPERIMENTAL)" - depends on EXPERIMENTAL && NF_CONNTRACK + bool "Connection tracking events" + depends on NF_CONNTRACK depends on NETFILTER_ADVANCED help If this option is enabled, the connection tracking code will
@@ -102,8 +102,8 @@ config NF_CT_PROTO_SCTP <file:Documentation/kbuild/modules.txt>. If unsure, say `N'. config NF_CT_PROTO_UDPLITE - tristate 'UDP-Lite protocol connection tracking support (EXPERIMENTAL)' - depends on EXPERIMENTAL && NF_CONNTRACK + tristate 'UDP-Lite protocol connection tracking support' + depends on NF_CONNTRACK depends on NETFILTER_ADVANCED help With this option enabled, the layer 3 independent connection
@@ -144,8 +144,8 @@ config NF_CONNTRACK_FTP To compile it as a module, choose M here. If unsure, say N. config NF_CONNTRACK_H323 - tristate "H.323 protocol support (EXPERIMENTAL)" - depends on EXPERIMENTAL && NF_CONNTRACK && (IPV6 || IPV6=n) + tristate "H.323 protocol support" + depends on NF_CONNTRACK && (IPV6 || IPV6=n) depends on NETFILTER_ADVANCED help H.323 is a VoIP signalling protocol from ITU-T. As one of the most
@@ -180,8 +180,8 @@ config NF_CONNTRACK_IRC To compile it as a module, choose M here. If unsure, say N. config NF_CONNTRACK_NETBIOS_NS - tristate "NetBIOS name service protocol support (EXPERIMENTAL)" - depends on EXPERIMENTAL && NF_CONNTRACK + tristate "NetBIOS name service protocol support" + depends on NF_CONNTRACK depends on NETFILTER_ADVANCED help NetBIOS name service requests are sent as broadcast messages from an
@@ -234,8 +234,8 @@ config NF_CONNTRACK_SANE To compile it as a module, choose M here. If unsure, say N. config NF_CONNTRACK_SIP - tristate "SIP protocol support (EXPERIMENTAL)" - depends on EXPERIMENTAL && NF_CONNTRACK + tristate "SIP protocol support" + depends on NF_CONNTRACK default m if NETFILTER_ADVANCED=n help SIP is an application-layer control protocol that can establish,
@@ -259,8 +259,8 @@ config NF_CONNTRACK_TFTP To compile it as a module, choose M here. If unsure, say N. config NF_CT_NETLINK - tristate 'Connection tracking netlink interface (EXPERIMENTAL)' - depends on EXPERIMENTAL && NF_CONNTRACK + tristate 'Connection tracking netlink interface' + depends on NF_CONNTRACK select NETFILTER_NETLINK depends on NF_NAT=n || NF_NAT default m if NETFILTER_ADVANCED=n
PATCH 3/38 : remove ipt_TOS.c
In reply to Patrick McHardy[NETFILTER]: remove ipt_TOS.c
Commit 88c85d81f74f92371745158aebc5cbf490412002 forgot to remove the old ipt_TOS file (whose code has been merged into xt_DSCP). Remove it now.
---
commit 97522ed78f619506ef818b7a7b1160735b47c367
tree db654ff7ce108e2e277ebeeec7678c4603d60621
parent 9eef50d726e834652abc7aca9740b62fbb89c124
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:09 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:22 +0100
net/ipv4/netfilter/ipt_TOS.c | 82 ------------------------------------------ 1 files changed, 0 insertions(+), 82 deletions(-)
net/ipv4/netfilter/ipt_TOS.c deleted +0 -82
@@ -1,82 +0,0 @@ -/* This is a module which is used for setting the TOS field of a packet. */ - -/* (C) 1999-2001 Paul `Rusty' Russell -* (C) 2002-2004 Netfilter Core Team <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#include <linux/module.h> -#include <linux/skbuff.h> -#include <linux/ip.h> -#include <net/checksum.h> - -#include <linux/netfilter/x_tables.h> -#include <linux/netfilter_ipv4/ipt_TOS.h> - -MODULE_LICENSE ("GPL" ); -MODULE_AUTHOR ("Netfilter Core Team <[email protected]>" ); -MODULE_DESCRIPTION ("iptables TOS mangling module" ); - -static unsigned int -tos_tg (struct sk_buff *skb,const struct net_device *in, -const struct net_device *out,unsigned int hooknum, -const struct xt_target *target,const void *targinfo) -{ -const struct ipt_tos_target_info *tosinfo = targinfo; -struct iphdr *iph =ip_hdr (skb); - -if ((iph->tos &IPTOS_TOS_MASK ) != tosinfo->tos) { -__u8 oldtos; -if (!skb_make_writable (skb,sizeof (struct iphdr ))) -return NF_DROP ; - iph =ip_hdr (skb); - oldtos = iph->tos; - iph->tos = (iph->tos &IPTOS_PREC_MASK ) | tosinfo->tos; -csum_replace2 (&iph->check,htons (oldtos),htons (iph->tos)); - } -return XT_CONTINUE ; -} - -static bool -tos_tg_check (const char *tablename,const void *e_void, -const struct xt_target *target,void *targinfo, -unsigned int hook_mask) -{ -const u_int8_t tos = ((struct ipt_tos_target_info *)targinfo)->tos; - -if (tos !=IPTOS_LOWDELAY - && tos !=IPTOS_THROUGHPUT - && tos !=IPTOS_RELIABILITY - && tos !=IPTOS_MINCOST - && tos !=IPTOS_NORMALSVC ) { -printk (KERN_WARNING "TOS: bad tos value %#x\n" , tos); -return false; - } -return true; -} - -static struct xt_target tos_tg_reg__read_mostly = { - .name ="TOS" , - .family =AF_INET , - .target = tos_tg, - .targetsize =sizeof (struct ipt_tos_target_info ), - .table ="mangle" , - .checkentry = tos_tg_check, - .me =THIS_MODULE , -}; - -static int __init tos_tg_init (void ) -{ -return xt_register_target (&tos_tg_reg); -} - -static void __exit tos_tg_exit(void) -{ -xt_unregister_target (&tos_tg_reg); -} - -module_init (tos_tg_init); -module_exit (tos_tg_exit);
PATCH 4/38 : xt_TOS: Change semantic of mask value
In reply to Patrick McHardy[NETFILTER]: xt_TOS: Change semantic of mask value
This patch changes the behavior of xt_TOS v1 so that the mask value the user supplies means "zero out these bits" rather than "keep these bits". This is more easy on the user, as (I would assume) people keep more bits than zeroing, so, an example:
Action: Set bit 0x01.
before (&): iptables -j TOS --set-tos 0x01/0xFE
after (&~): iptables -j TOS --set-tos 0x01/0x01This is not too "tragic" with xt_TOS, but where larger fields are used (e.g. proposed xt_MARK v2), --set-xmar 0x01/0x01 vs. --set-xmark 0x01/0xFFFFFFFE really makes a difference. Other target(!) modules, such as xt_TPROXY also use &~ rather than &, so let's get to a common ground.
(Since xt_TOS has not yet left the development tree en direction to mainline, the semantic can be changed as proposed without breaking iptables.)
---
commit b0b6c99174c0d7d9512cd84e50da2c4426e6ae06
tree 8bf104996345ef071b26c8b64fc668d033aefb77
parent 97522ed78f619506ef818b7a7b1160735b47c367
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:12 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:23 +0100
net/netfilter/xt_DSCP.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/netfilter/xt_DSCP.c +1 -1
@@ -128,7 +128,7 @@ tos_tg(struct sk_buff *skb, const struct net_device *in,u_int8_t orig, nv; orig =ipv4_get_dsfield (iph); - nv = (orig & info->tos_mask) ^ info->tos_value; + nv = (orig & ~info->tos_mask) ^ info->tos_value;if (orig != nv) {if (!skb_make_writable (skb,sizeof (struct iphdr )))
PATCH 5/38 : xt_TOS: Properly set the TOS field
In reply to Patrick McHardy[NETFILTER]: xt_TOS: Properly set the TOS field
Fix incorrect mask value passed to ipv4_change_dsfield/ipv6_change_dsfield.
---
commit 89efd08437074cc2005dc258622866efa187c46a
tree 9614972fb51ab77899d80d89a50b363c438ff74f
parent b0b6c99174c0d7d9512cd84e50da2c4426e6ae06
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:15 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:23 +0100
net/netfilter/xt_DSCP.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
net/netfilter/xt_DSCP.c +2 -2
@@ -134,7 +134,7 @@ tos_tg(struct sk_buff *skb, const struct net_device *in,if (!skb_make_writable (skb,sizeof (struct iphdr )))return NF_DROP ; iph =ip_hdr (skb); -ipv4_change_dsfield (iph, ~0 , nv); +ipv4_change_dsfield (iph,0 , nv); }return XT_CONTINUE ;
@@ -156,7 +156,7 @@ tos_tg6(struct sk_buff *skb, const struct net_device *in,if (!skb_make_writable (skb,sizeof (struct iphdr )))return NF_DROP ; iph =ipv6_hdr (skb); -ipv6_change_dsfield (iph, ~0 , nv); +ipv6_change_dsfield (iph,0 , nv); }return XT_CONTINUE ;
PATCH 6/38 : Annotate start of kernel fields in NF headers
In reply to Patrick McHardy[NETFILTER]: Annotate start of kernel fields in NF headers
---
commit cf9efd38322201c52e424d16a304ce9970697f8f
tree fa34f1a03d9dc898c7e446b7a74ea02c616b4d5f
parent 89efd08437074cc2005dc258622866efa187c46a
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:21 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:24 +0100
include/linux/netfilter/xt_RATEEST.h | 2 ++ include/linux/netfilter/xt_connlimit.h | 2 +- include/linux/netfilter/xt_hashlimit.h | 2 +- include/linux/netfilter/xt_quota.h | 2 ++ include/linux/netfilter/xt_rateest.h | 2 ++ include/linux/netfilter/xt_statistic.h | 1 + include/linux/netfilter/xt_string.h | 2 ++ include/linux/netfilter_ipv4/ipt_CLUSTERIP.h | 1 + 8 files changed, 12 insertions(+), 2 deletions(-)
include/linux/netfilter/xt_RATEEST.h +2 -0
@@ -5,6 +5,8 @@ struct xt_rateest_target_info {char name[IFNAMSIZ ];int8_t interval;u_int8_t ewma_log; + +/* Used internally by the kernel */ struct xt_rateest *est __attribute__((aligned(8))); };
include/linux/netfilter/xt_connlimit.h +1 -1
@@ -15,7 +15,7 @@ struct xt_connlimit_info { };unsigned int limit, inverse; -/* this needs to be at the end */ +/* Used internally by the kernel */ struct xt_connlimit_data *data __attribute__((aligned(8))); };
include/linux/netfilter/xt_hashlimit.h +1 -1
@@ -29,9 +29,9 @@ struct hashlimit_cfg {struct xt_hashlimit_info {char name [IFNAMSIZ ];/* name */ struct hashlimit_cfg cfg; -struct xt_hashlimit_htable *hinfo;/* Used internally by the kernel */ +struct xt_hashlimit_htable *hinfo;union {void *ptr;struct xt_hashlimit_info *master;
include/linux/netfilter/xt_quota.h +2 -0
@@ -9,6 +9,8 @@ enum xt_quota_flags {struct xt_quota_info {u_int32_t flags;u_int32_t pad; + +/* Used internally by the kernel */ aligned_u64 quota;struct xt_quota_info *master; };
include/linux/netfilter/xt_rateest.h +2 -0
@@ -26,6 +26,8 @@ struct xt_rateest_match_info {u_int32_t pps1;u_int32_t bps2;u_int32_t pps2; + +/* Used internally by the kernel */ struct xt_rateest *est1 __attribute__((aligned(8))); struct xt_rateest *est2 __attribute__((aligned(8))); };
include/linux/netfilter/xt_statistic.h +1 -0
@@ -23,6 +23,7 @@ struct xt_statistic_info {struct {u_int32_t every;u_int32_t packet; +/* Used internally by the kernel */ u_int32_t count; } nth; } u;
include/linux/netfilter/xt_string.h +2 -0
@@ -12,6 +12,8 @@ struct xt_string_infochar pattern[XT_STRING_MAX_PATTERN_SIZE ];u_int8_t patlen;u_int8_t invert; + +/* Used internally by the kernel */ struct ts_config __attribute__((aligned (8 ))) *config; };
include/linux/netfilter_ipv4/ipt_CLUSTERIP.h +1 -0
@@ -27,6 +27,7 @@ struct ipt_clusterip_tgt_info {u_int32_t hash_mode;u_int32_t hash_initval; +/* Used internally by the kernel */ struct clusterip_config *config; };
PATCH 7/38 : xt_CONNMARK target, revision 1
In reply to Patrick McHardy[NETFILTER]: xt_CONNMARK target, revision 1
Introduces the xt_CONNMARK target revision 1. It uses fixed types, and also uses the more expressive XOR logic. Futhermore, it allows to selectively pick bits from both the ctmark and the nfmark in the SAVE and RESTORE operations.
---
commit 49f994a1775f0f3284375f00d10b2251c0070528
tree 901d577d25ce2dcf63d3b8639f59bbd9f013c637
parent cf9efd38322201c52e424d16a304ce9970697f8f
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:25 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:24 +0100
include/linux/netfilter/xt_CONNMARK.h | 5 + net/netfilter/xt_CONNMARK.c | 117 +++++++++++++++++++++++++++------ 2 files changed, 102 insertions(+), 20 deletions(-)
include/linux/netfilter/xt_CONNMARK.h +5 -0
@@ -22,4 +22,9 @@ struct xt_connmark_target_info { u_int8_t mode; }; +struct xt_connmark_tginfo1 { +u_int32_t ctmark, ctmask, nfmask; +u_int8_t mode; +}; +#endif /*_XT_CONNMARK_H_target*/
net/netfilter/xt_CONNMARK.c +97 -20
176 lines not on this page · raw message
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/38 : xt_MARK target, revision 2
In reply to Patrick McHardy[NETFILTER]: xt_MARK target, revision 2
Introduces the xt_MARK target revision 2. It uses fixed types, and also uses the more expressive XOR logic.
---
commit 158847483305cdda53fa8c786a41a9cbfa692528
tree f42c759081ada7a5b0a99b5b8e5fd244dc3b9c54
parent 49f994a1775f0f3284375f00d10b2251c0070528
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:27 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:25 +0100
include/linux/netfilter/xt_MARK.h | 4 ++ net/netfilter/xt_MARK.c | 74 ++++++++++++++++++++++++++----------- 2 files changed, 56 insertions(+), 22 deletions(-)
include/linux/netfilter/xt_MARK.h +4 -0
@@ -18,4 +18,8 @@ struct xt_mark_target_info_v1 { u_int8_t mode; }; +struct xt_mark_tginfo2 { +u_int32_t mark, mask; +}; +#endif /*_XT_MARK_H_target */
net/netfilter/xt_MARK.c +52 -22
138 lines not on this page · raw message
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 9/38 : xt_connmark match, revision 1
In reply to Patrick McHardy[NETFILTER]: xt_connmark match, revision 1
Introduces the xt_connmark match revision 1. It uses fixed types, eventually obsoleting revision 0 some day (uses nonfixed types). (Unfixed types like "unsigned long" do not play well with mixed user-/kernelspace "bitness", e.g. 32/64, as is common on SPARC64, and need extra compat code.)
---
commit e1b4563007f6a292af1b18b575f5c36f998155c0
tree ae84cf34ab573096f497fc26d8455e3730ddcf04
parent 158847483305cdda53fa8c786a41a9cbfa692528
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:29 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:25 +0100
include/linux/netfilter/xt_connmark.h | 5 ++ net/netfilter/xt_connmark.c | 88 +++++++++++++++++++++++++++------ 2 files changed, 76 insertions(+), 17 deletions(-)
include/linux/netfilter/xt_connmark.h +5 -0
@@ -15,4 +15,9 @@ struct xt_connmark_info { u_int8_t invert; }; +struct xt_connmark_mtinfo1 { +u_int32_t mark, mask; +u_int8_t invert; +}; +#endif /*_XT_CONNMARK_H*/
net/netfilter/xt_connmark.c +71 -17
146 lines not on this page · raw message
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 10/38 : Extend nf_inet_addr with in{,6}_addr
In reply to Patrick McHardy[NETFILTER]: Extend nf_inet_addr with in{,6}_addr
Extend union nf_inet_addr with struct in_addr and in6_addr. Useful because a lot of in-kernel IPv4 and IPv6 functions use in_addr/in6_addr.
---
commit eecfb07f489d73875a46d4a7c9270f92596adf88
tree bd09665b0b785bc99bf7ca4bf97d3a817c42592b
parent e1b4563007f6a292af1b18b575f5c36f998155c0
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:30 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:25 +0100
include/linux/netfilter.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/netfilter.h +4 -0
@@ -7,6 +7,8 @@#include <linux/skbuff.h> #include <linux/net.h> #include <linux/if.h> +#include <linux/in.h> +#include <linux/in6.h> #include <linux/wait.h> #include <linux/list.h> #endif
@@ -52,6 +54,8 @@ union nf_inet_addr {u_int32_t all[4 ];__be32 ip;__be32 ip6[4 ]; +struct in_addr in; +struct in6_addr in6; };#ifdef __KERNEL__
PATCH 11/38 : xt_conntrack match, revision 1
In reply to Patrick McHardy[NETFILTER]: xt_conntrack match, revision 1
Introduces the xt_conntrack match revision 1. It uses fixed types, the new nf_inet_addr and comes with IPv6 support, thereby completely superseding xt_state.
---
commit b222e77b3dc12bb1765559d1aec2bc2701d5e913
tree b39e728f72f678814902b81baf51b5e4c42685d1
parent eecfb07f489d73875a46d4a7c9270f92596adf88
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:31 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:23:26 +0100
include/linux/netfilter/xt_conntrack.h | 16 ++ net/netfilter/xt_conntrack.c | 207 ++++++++++++++++++++++++++++---- 2 files changed, 197 insertions(+), 26 deletions(-)
include/linux/netfilter/xt_conntrack.h +15 -1
@@ -6,7 +6,9 @@#define _XT_CONNTRACK_H#include <linux/netfilter/nf_conntrack_tuple_common.h> -#include <linux/in.h> +#ifdef __KERNEL__ +# include <linux/in.h> +#endif #define XT_CONNTRACK_STATE_BIT (ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))#define XT_CONNTRACK_STATE_INVALID (1 << 0)
@@ -60,4 +62,16 @@ struct xt_conntrack_info/* Inverse flags */ u_int8_t invflags; }; + +struct xt_conntrack_mtinfo1 { +union nf_inet_addr origsrc_addr, origsrc_mask; +union nf_inet_addr origdst_addr, origdst_mask; +union nf_inet_addr replsrc_addr, replsrc_mask; +union nf_inet_addr repldst_addr, repldst_mask; +u_int32_t expires_min, expires_max; +u_int16_t l4proto; +u_int8_t state_mask, status_mask; +u_int8_t match_flags, invert_flags; +}; +#endif /*_XT_CONNTRACK_H*/
net/netfilter/xt_conntrack.c +182 -25
258 lines not on this page · raw message
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 12/38 : xt_mark match, revision 1
In reply to Patrick McHardy[NETFILTER]: xt_mark match, revision 1
Introduces the xt_mark match revision 1. It uses fixed types, eventually obsoleting revision 0 some day (uses nonfixed types).
---
commit 72c54af2cbc724b17aa0b4e58718311dd70617df
tree 7ec4ce8476efa20d77432f6581faececef7a2689
parent b222e77b3dc12bb1765559d1aec2bc2701d5e913
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:34 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:17 +0100
include/linux/netfilter/xt_mark.h | 5 +++ net/netfilter/xt_mark.c | 72 +++++++++++++++++++++++++++---------- 2 files changed, 57 insertions(+), 20 deletions(-)
include/linux/netfilter/xt_mark.h +5 -0
@@ -6,4 +6,9 @@ struct xt_mark_info { u_int8_t invert; }; +struct xt_mark_mtinfo1 { +u_int32_t mark, mask; +u_int8_t invert; +}; +#endif /*_XT_MARK_H*/
net/netfilter/xt_mark.c +52 -20
125 lines not on this page · raw message
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 13/38 : xt_pkttype: Add explicit check for IPv4
In reply to Patrick McHardy[NETFILTER]: xt_pkttype: Add explicit check for IPv4
In the PACKET_LOOPBACK case, the skb data was always interpreted as IPv4, but that is not valid for IPv6, obviously. Fix this by adding an extra condition to check for AF_INET.
---
commit 65196922f6f712071d1d559406348c5ba9c9810c
tree eead1feb27c9cdeeb316638e9ddb48d4f775e6b6
parent 72c54af2cbc724b17aa0b4e58718311dd70617df
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:35 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:17 +0100
net/netfilter/xt_pkttype.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
net/netfilter/xt_pkttype.c +2 -1
@@ -31,7 +31,8 @@ pkttype_mt(const struct sk_buff *skb, const struct net_device *in,const struct xt_pkttype_info *info = matchinfo;if (skb->pkt_type ==PACKET_LOOPBACK ) - type =ipv4_is_multicast (ip_hdr (skb)->daddr) + type = match->family ==AF_INET && +ipv4_is_multicast (ip_hdr (skb)->daddr) ?PACKET_MULTICAST :PACKET_BROADCAST ;else
PATCH 14/38 : xt_pkttype: IPv6 multicast address recognition
In reply to Patrick McHardy[NETFILTER]: xt_pkttype: IPv6 multicast address recognition
---
commit 109069cb6db009d150c385451a63461fe9d5c42e
tree f12db52a8a1c5209fd7385bf1b8065c734f8e348
parent 65196922f6f712071d1d559406348c5ba9c9810c
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:37 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:18 +0100
net/netfilter/xt_pkttype.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-)
net/netfilter/xt_pkttype.c +11 -7
@@ -11,6 +11,7 @@#include <linux/if_packet.h> #include <linux/in.h> #include <linux/ip.h> +#include <linux/ipv6.h> #include <linux/netfilter/xt_pkttype.h> #include <linux/netfilter/x_tables.h>
@@ -27,16 +28,19 @@ pkttype_mt(const struct sk_buff *skb, const struct net_device *in, const void *matchinfo, int offset, unsigned int protoff, bool *hotdrop) { - u_int8_t type; const struct xt_pkttype_info *info = matchinfo; +u_int8_t type; -if (skb->pkt_type ==PACKET_LOOPBACK ) - type = match->family ==AF_INET && -ipv4_is_multicast (ip_hdr (skb)->daddr) - ?PACKET_MULTICAST - :PACKET_BROADCAST ; -else +if (skb->pkt_type !=PACKET_LOOPBACK ) type = skb->pkt_type; +else if (match->family ==AF_INET && +ipv4_is_multicast (ip_hdr (skb)->daddr)) + type =PACKET_MULTICAST ; +else if (match->family ==AF_INET6 && +ipv6_hdr (skb)->daddr.s6_addr[0 ] ==0xFF ) + type =PACKET_MULTICAST ; +else + type =PACKET_BROADCAST ;return (type == info->pkttype) ^ info->invert; }
PATCH 15/38 : xt_policy: use the new union nf_inet_addr
In reply to Patrick McHardy[NETFILTER]: xt_policy: use the new union nf_inet_addr
---
commit 9793ea135e7d8ad359f3fd35b94fe89faa0e88a3
tree 5caafc6eed4688a307996bd4a43bfad94c8ff5b4
parent 109069cb6db009d150c385451a63461fe9d5c42e
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:38 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:19 +0100
include/linux/netfilter/xt_policy.h | 23 +++++++++++++++++++---- net/netfilter/xt_policy.c | 15 ++++++++------- 2 files changed, 27 insertions(+), 11 deletions(-)
include/linux/netfilter/xt_policy.h +19 -4
@@ -27,18 +27,33 @@ struct xt_policy_spec reqid:1 ; }; +#ifndef __KERNEL__union xt_policy_addr {struct in_addr a4;struct in6_addr a6; }; +#endif struct xt_policy_elem { -union xt_policy_addr saddr; -union xt_policy_addr smask; -union xt_policy_addr daddr; -union xt_policy_addr dmask; +union { +#ifdef __KERNEL__ +struct { +union nf_inet_addr saddr; +union nf_inet_addr smask; +union nf_inet_addr daddr; +union nf_inet_addr dmask; + }; +#else +struct { +union xt_policy_addr saddr; +union xt_policy_addr smask; +union xt_policy_addr daddr; +union xt_policy_addr dmask; + }; +#endif + };__be32 spi;u_int32_t reqid;u_int8_t proto;
net/netfilter/xt_policy.c +8 -7
@@ -13,6 +13,7 @@#include <linux/init.h> #include <net/xfrm.h> +#include <linux/netfilter.h> #include <linux/netfilter/xt_policy.h> #include <linux/netfilter/x_tables.h>
@@ -21,14 +22,14 @@ MODULE_DESCRIPTION("Xtables IPsec policy matching module");MODULE_LICENSE ("GPL" );static inline bool -xt_addr_cmp (const union xt_policy_addr *a1,const union xt_policy_addr *m, -const union xt_policy_addr *a2,unsigned short family) +xt_addr_cmp (const union nf_inet_addr *a1,const union nf_inet_addr *m, +const union nf_inet_addr *a2,unsigned short family) {switch (family) {case AF_INET : -return !((a1->a4.s_addr ^ a2->a4.s_addr) & m->a4.s_addr); +return ((a1->ip ^ a2->ip) & m->ip) ==0 ;case AF_INET6 : -return !ipv6_masked_addr_cmp (&a1->a6, &m->a6, &a2->a6); +return ipv6_masked_addr_cmp (&a1->in6, &m->in6, &a2->in6) ==0 ; }return false; }
@@ -38,12 +39,12 @@ match_xfrm_state(const struct xfrm_state *x, const struct xt_policy_elem *e, unsigned short family) {#define MATCH_ADDR (x,y,z) (!e->match.x || \ - (xt_addr_cmp(&e->x, &e->y, (z), family) \ + (xt_addr_cmp(&e->x, &e->y, (const union nf_inet_addr *)(z), family) \ ^ e->invert.x))#define MATCH (x,y) (!e->match.x || ((e->x == (y)) ^ e->invert.x)) -return MATCH_ADDR (saddr, smask, (union xt_policy_addr *)&x->props.saddr) && -MATCH_ADDR (daddr, dmask, (union xt_policy_addr *)&x->id.daddr) && +return MATCH_ADDR (saddr, smask, &x->props.saddr) && +MATCH_ADDR (daddr, dmask, &x->id.daddr) &&MATCH (proto, x->id.proto) &&MATCH (mode, x->props.mode) && MATCH(spi, x->id.spi) &&
PATCH 16/38 : Update modules' descriptions
In reply to Patrick McHardy[NETFILTER]: Update modules' descriptions
Updates the MODULE_DESCRIPTION() tags for all Netfilter modules, actually describing what the module does and not just "netfilter XYZ target".
---
commit 1834195893f1df31c850cf93281e4a88e2cfad9b
tree 4ee31ded35ae277bef8a3c123a54f58e34b383f8
parent 9793ea135e7d8ad359f3fd35b94fe89faa0e88a3
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:40 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:20 +0100
net/ipv4/netfilter/ipt_CLUSTERIP.c | 2 +- net/ipv4/netfilter/ipt_ECN.c | 2 +- net/ipv4/netfilter/ipt_LOG.c | 2 +- net/ipv4/netfilter/ipt_MASQUERADE.c | 2 +- net/ipv4/netfilter/ipt_NETMAP.c | 2 +- net/ipv4/netfilter/ipt_REDIRECT.c | 2 +- net/ipv4/netfilter/ipt_REJECT.c | 2 +- net/ipv4/netfilter/ipt_TTL.c | 2 +- net/ipv4/netfilter/ipt_ULOG.c | 2 +- net/ipv4/netfilter/ipt_addrtype.c | 2 +- net/ipv4/netfilter/ipt_ah.c | 2 +- net/ipv4/netfilter/ipt_ecn.c | 2 +- net/ipv4/netfilter/ipt_iprange.c | 2 +- net/ipv4/netfilter/ipt_recent.c | 2 +- net/ipv4/netfilter/ipt_ttl.c | 2 +- net/ipv6/netfilter/ip6t_HL.c | 2 +- net/ipv6/netfilter/ip6t_LOG.c | 2 +- net/ipv6/netfilter/ip6t_REJECT.c | 2 +- net/ipv6/netfilter/ip6t_ah.c | 2 +- net/ipv6/netfilter/ip6t_eui64.c | 2 +- net/ipv6/netfilter/ip6t_frag.c | 2 +- net/ipv6/netfilter/ip6t_hbh.c | 2 +- net/ipv6/netfilter/ip6t_hl.c | 2 +- net/ipv6/netfilter/ip6t_ipv6header.c | 2 +- net/ipv6/netfilter/ip6t_mh.c | 2 +- net/ipv6/netfilter/ip6t_rt.c | 2 +- net/netfilter/xt_CLASSIFY.c | 2 +- net/netfilter/xt_CONNMARK.c | 2 +- net/netfilter/xt_CONNSECMARK.c | 2 +- net/netfilter/xt_DSCP.c | 2 +- net/netfilter/xt_MARK.c | 2 +- net/netfilter/xt_NFLOG.c | 2 +- net/netfilter/xt_NFQUEUE.c | 2 +- net/netfilter/xt_NOTRACK.c | 1 + net/netfilter/xt_RATEEST.c | 2 +- net/netfilter/xt_SECMARK.c | 2 +- net/netfilter/xt_TCPMSS.c | 2 +- net/netfilter/xt_TCPOPTSTRIP.c | 2 +- net/netfilter/xt_TRACE.c | 1 + net/netfilter/xt_comment.c | 2 +- net/netfilter/xt_connbytes.c | 2 +- net/netfilter/xt_connlimit.c | 2 +- net/netfilter/xt_connmark.c | 2 +- net/netfilter/xt_conntrack.c | 2 +- net/netfilter/xt_dccp.c | 2 +- net/netfilter/xt_dscp.c | 2 +- net/netfilter/xt_esp.c | 2 +- net/netfilter/xt_hashlimit.c | 2 +- net/netfilter/xt_helper.c | 2 +- net/netfilter/xt_length.c | 2 +- net/netfilter/xt_limit.c | 2 +- net/netfilter/xt_mac.c | 2 +- net/netfilter/xt_mark.c | 2 +- net/netfilter/xt_multiport.c | 2 +- net/netfilter/xt_owner.c | 2 +- net/netfilter/xt_physdev.c | 2 +- net/netfilter/xt_pkttype.c | 2 +- net/netfilter/xt_policy.c | 2 +- net/netfilter/xt_quota.c | 1 + net/netfilter/xt_realm.c | 2 +- net/netfilter/xt_sctp.c | 2 +- net/netfilter/xt_statistic.c | 2 +- net/netfilter/xt_string.c | 2 +- net/netfilter/xt_tcpmss.c | 2 +- net/netfilter/xt_tcpudp.c | 2 +- net/netfilter/xt_time.c | 2 +- net/netfilter/xt_u32.c | 2 +- 67 files changed, 67 insertions(+), 64 deletions(-)
net/ipv4/netfilter/ipt_CLUSTERIP.c +1 -1
@@ -32,7 +32,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("iptables target for CLUSTERIP" ); +MODULE_DESCRIPTION ("Xtables: CLUSTERIP target" );struct clusterip_config {struct list_head list;/* list of all configs */
net/ipv4/netfilter/ipt_ECN.c +1 -1
@@ -21,7 +21,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("iptables ECN modification module" ); +MODULE_DESCRIPTION ("Xtables: Explicit Congestion Notification (ECN) flag modification" );/* set ECT codepoint from IP header. * return false if there was an error. */
net/ipv4/netfilter/ipt_LOG.c +1 -1
@@ -26,7 +26,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Netfilter Core Team <[email protected]>" ); -MODULE_DESCRIPTION ("iptables syslog logging module" ); +MODULE_DESCRIPTION ("Xtables: IPv4 packet logging to syslog" );/* Use lock to serialize, so printks don't overlap */ static DEFINE_SPINLOCK (log_lock);
net/ipv4/netfilter/ipt_MASQUERADE.c +1 -1
@@ -25,7 +25,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Netfilter Core Team <[email protected]>" ); -MODULE_DESCRIPTION ("iptables MASQUERADE target module" ); +MODULE_DESCRIPTION ("Xtables: automatic-address SNAT" );/* Lock protects masq region inside conntrack */ static DEFINE_RWLOCK (masq_lock);
net/ipv4/netfilter/ipt_NETMAP.c +1 -1
@@ -20,7 +20,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Svenning Soerensen <[email protected]>" ); -MODULE_DESCRIPTION ("iptables 1:1 NAT mapping of IP networks target" ); +MODULE_DESCRIPTION ("Xtables: 1:1 NAT mapping of IPv4 subnets" ); static bool netmap_tg_check(const char *tablename, const void *e,
net/ipv4/netfilter/ipt_REDIRECT.c +1 -1
@@ -23,7 +23,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Netfilter Core Team <[email protected]>" ); -MODULE_DESCRIPTION ("iptables REDIRECT target module" ); +MODULE_DESCRIPTION ("Xtables: Connection redirection to localhost" );/* FIXME: Take multiple ranges --RR */ static bool
net/ipv4/netfilter/ipt_REJECT.c +1 -1
@@ -29,7 +29,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Netfilter Core Team <[email protected]>" ); -MODULE_DESCRIPTION ("iptables REJECT target module" ); +MODULE_DESCRIPTION ("Xtables: packet \"rejection\" target for IPv4" );/* Send RST reply */ static void send_reset (struct sk_buff *oldskb,int hook)
net/ipv4/netfilter/ipt_TTL.c +1 -1
@@ -16,7 +16,7 @@#include <linux/netfilter_ipv4/ipt_TTL.h> MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("IP tables TTL modification module" ); +MODULE_DESCRIPTION ("Xtables: IPv4 TTL field modification target" );MODULE_LICENSE ("GPL" ); static unsigned int
net/ipv4/netfilter/ipt_ULOG.c +1 -1
@@ -50,7 +50,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("iptables userspace logging module" ); +MODULE_DESCRIPTION ("Xtables: packet logging to netlink using ULOG" );MODULE_ALIAS_NET_PF_PROTO (PF_NETLINK ,NETLINK_NFLOG );#define ULOG_NL_EVENT 111/* Harald's favorite number */
net/ipv4/netfilter/ipt_addrtype.c +1 -1
@@ -21,7 +21,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Patrick McHardy <[email protected]>" ); -MODULE_DESCRIPTION ("iptables addrtype match" ); +MODULE_DESCRIPTION ("Xtables: address type match for IPv4" );static inline bool match_type (const struct net_device *dev,__be32 addr,u_int16_t mask)
net/ipv4/netfilter/ipt_ah.c +1 -1
@@ -16,7 +16,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Yon Uriarte <[email protected]>" ); -MODULE_DESCRIPTION ("iptables AH SPI match module" ); +MODULE_DESCRIPTION ("Xtables: IPv4 IPsec-AH SPI match" );#ifdef DEBUG_CONNTRACK #define duprintf(format, args...) printk(format , ## args)
net/ipv4/netfilter/ipt_ecn.c +1 -1
@@ -19,7 +19,7 @@#include <linux/netfilter_ipv4/ipt_ecn.h> MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("iptables ECN matching module" ); +MODULE_DESCRIPTION ("Xtables: Explicit Congestion Notification (ECN) flag match for IPv4" );MODULE_LICENSE ("GPL" ); static inline bool match_ip(const struct sk_buff *skb,
net/ipv4/netfilter/ipt_iprange.c +1 -1
@@ -15,7 +15,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Jozsef Kadlecsik <[email protected]>" ); -MODULE_DESCRIPTION ("iptables arbitrary IP range match module" ); +MODULE_DESCRIPTION ("Xtables: arbitrary IPv4 range matching" ); static bool iprange_mt(const struct sk_buff *skb, const struct net_device *in,
net/ipv4/netfilter/ipt_recent.c +1 -1
@@ -30,7 +30,7 @@#include <linux/netfilter_ipv4/ipt_recent.h> MODULE_AUTHOR ("Patrick McHardy <[email protected]>" ); -MODULE_DESCRIPTION ("IP tables recently seen matching module" ); +MODULE_DESCRIPTION ("Xtables: \"recently-seen\" host matching for IPv4" );MODULE_LICENSE ("GPL" );static unsigned int ip_list_tot =100 ;
net/ipv4/netfilter/ipt_ttl.c +1 -1
@@ -15,7 +15,7 @@#include <linux/netfilter/x_tables.h> MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("IP tables TTL matching module" ); +MODULE_DESCRIPTION ("Xtables: IPv4 TTL field match" );MODULE_LICENSE ("GPL" ); static bool
net/ipv6/netfilter/ip6t_HL.c +1 -1
@@ -15,7 +15,7 @@#include <linux/netfilter_ipv6/ip6t_HL.h> MODULE_AUTHOR ("Maciej Soltysiak <[email protected]>" ); -MODULE_DESCRIPTION ("IP6 tables Hop Limit modification module" ); +MODULE_DESCRIPTION ("Xtables: IPv6 Hop Limit field modification target" );MODULE_LICENSE ("GPL" ); static unsigned int
net/ipv6/netfilter/ip6t_LOG.c +1 -1
@@ -26,7 +26,7 @@#include <net/netfilter/nf_log.h> MODULE_AUTHOR ("Jan Rekorajski <[email protected]>" ); -MODULE_DESCRIPTION ("IP6 tables LOG target module" ); +MODULE_DESCRIPTION ("Xtables: IPv6 packet logging to syslog" );MODULE_LICENSE ("GPL" );struct in_device ;
net/ipv6/netfilter/ip6t_REJECT.c +1 -1
@@ -31,7 +31,7 @@#include <linux/netfilter_ipv6/ip6t_REJECT.h> MODULE_AUTHOR ("Yasuyuki KOZAKAI <[email protected]>" ); -MODULE_DESCRIPTION ("IP6 tables REJECT target module" ); +MODULE_DESCRIPTION ("Xtables: packet \"rejection\" target for IPv6" );MODULE_LICENSE ("GPL" );/* Send RST reply */
net/ipv6/netfilter/ip6t_ah.c +1 -1
@@ -20,7 +20,7 @@#include <linux/netfilter_ipv6/ip6t_ah.h> MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("IPv6 AH match" ); +MODULE_DESCRIPTION ("Xtables: IPv6 IPsec-AH match" );MODULE_AUTHOR ("Andras Kis-Szabo <[email protected]>" );/* Returns 1 if the spi is matched by the range, 0 otherwise */
net/ipv6/netfilter/ip6t_eui64.c +1 -1
@@ -15,7 +15,7 @@#include <linux/netfilter/x_tables.h> #include <linux/netfilter_ipv6/ip6_tables.h> -MODULE_DESCRIPTION ("IPv6 EUI64 address checking match" ); +MODULE_DESCRIPTION ("Xtables: IPv6 EUI64 address match" );MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Andras Kis-Szabo <[email protected]>" );
net/ipv6/netfilter/ip6t_frag.c +1 -1
@@ -19,7 +19,7 @@#include <linux/netfilter_ipv6/ip6t_frag.h> MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("IPv6 FRAG match" ); +MODULE_DESCRIPTION ("Xtables: IPv6 fragment match" );MODULE_AUTHOR ("Andras Kis-Szabo <[email protected]>" );/* Returns 1 if the id is matched by the range, 0 otherwise */
net/ipv6/netfilter/ip6t_hbh.c +1 -1
@@ -21,7 +21,7 @@#include <linux/netfilter_ipv6/ip6t_opts.h> MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("IPv6 opts match" ); +MODULE_DESCRIPTION ("Xtables: IPv6 Hop-By-Hop and Destination Header match" );MODULE_AUTHOR ("Andras Kis-Szabo <[email protected]>" );MODULE_ALIAS ("ip6t_dst" );
net/ipv6/netfilter/ip6t_hl.c +1 -1
@@ -16,7 +16,7 @@#include <linux/netfilter/x_tables.h> MODULE_AUTHOR ("Maciej Soltysiak <[email protected]>" ); -MODULE_DESCRIPTION ("IP tables Hop Limit matching module" ); +MODULE_DESCRIPTION ("Xtables: IPv6 Hop Limit field match" );MODULE_LICENSE ("GPL" ); static bool
net/ipv6/netfilter/ip6t_ipv6header.c +1 -1
@@ -23,7 +23,7 @@#include <linux/netfilter_ipv6/ip6t_ipv6header.h> MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("IPv6 headers match" ); +MODULE_DESCRIPTION ("Xtables: IPv6 header types match" );MODULE_AUTHOR ("Andras Kis-Szabo <[email protected]>" ); static bool
net/ipv6/netfilter/ip6t_mh.c +1 -1
@@ -21,7 +21,7 @@#include <linux/netfilter/x_tables.h> #include <linux/netfilter_ipv6/ip6t_mh.h> -MODULE_DESCRIPTION ("ip6t_tables match for MH" ); +MODULE_DESCRIPTION ("Xtables: IPv6 Mobility Header match" );MODULE_LICENSE ("GPL" );#ifdef DEBUG_IP_FIREWALL_USER
net/ipv6/netfilter/ip6t_rt.c +1 -1
@@ -21,7 +21,7 @@#include <linux/netfilter_ipv6/ip6t_rt.h> MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("IPv6 RT match" ); +MODULE_DESCRIPTION ("Xtables: IPv6 Routing Header match" );MODULE_AUTHOR ("Andras Kis-Szabo <[email protected]>" );/* Returns 1 if the id is matched by the range, 0 otherwise */
net/netfilter/xt_CLASSIFY.c +1 -1
@@ -22,7 +22,7 @@MODULE_AUTHOR ("Patrick McHardy <[email protected]>" );MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("iptables qdisc classification target module" ); +MODULE_DESCRIPTION ("Xtables: Qdisc classification" );MODULE_ALIAS ("ipt_CLASSIFY" );MODULE_ALIAS ("ip6t_CLASSIFY" );
net/netfilter/xt_CONNMARK.c +1 -1
@@ -26,7 +26,7 @@#include <net/checksum.h> MODULE_AUTHOR ("Henrik Nordstrom <[email protected]>" ); -MODULE_DESCRIPTION ("IP tables CONNMARK matching module" ); +MODULE_DESCRIPTION ("Xtables: connection mark modification" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_CONNMARK" );MODULE_ALIAS ("ip6t_CONNMARK" );
net/netfilter/xt_CONNSECMARK.c +1 -1
@@ -26,7 +26,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("James Morris <[email protected]>" ); -MODULE_DESCRIPTION ("ip[6]tables CONNSECMARK module" ); +MODULE_DESCRIPTION ("Xtables: target for copying between connection and security mark" );MODULE_ALIAS ("ipt_CONNSECMARK" );MODULE_ALIAS ("ip6t_CONNSECMARK" );
net/netfilter/xt_DSCP.c +1 -1
@@ -21,7 +21,7 @@#include <linux/netfilter_ipv4/ipt_TOS.h> MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("x_tables DSCP modification module" ); +MODULE_DESCRIPTION ("Xtables: DSCP/TOS field modification" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_DSCP" );MODULE_ALIAS ("ip6t_DSCP" );
net/netfilter/xt_MARK.c +1 -1
@@ -20,7 +20,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Marc Boucher <[email protected]>" ); -MODULE_DESCRIPTION ("ip[6]tables MARK modification module" ); +MODULE_DESCRIPTION ("Xtables: packet mark modification" );MODULE_ALIAS ("ipt_MARK" );MODULE_ALIAS ("ip6t_MARK" );
net/netfilter/xt_NFLOG.c +1 -1
@@ -15,7 +15,7 @@#include <net/netfilter/nf_log.h> MODULE_AUTHOR ("Patrick McHardy <[email protected]>" ); -MODULE_DESCRIPTION ("x_tables NFLOG target" ); +MODULE_DESCRIPTION ("Xtables: packet logging to netlink using NFLOG" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_NFLOG" );MODULE_ALIAS ("ip6t_NFLOG" );
net/netfilter/xt_NFQUEUE.c +1 -1
@@ -17,7 +17,7 @@#include <linux/netfilter/xt_NFQUEUE.h> MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("[ip,ip6,arp]_tables NFQUEUE target" ); +MODULE_DESCRIPTION ("Xtables: packet forwarding to netlink" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_NFQUEUE" );MODULE_ALIAS ("ip6t_NFQUEUE" );
net/netfilter/xt_NOTRACK.c +1 -0
@@ -7,6 +7,7 @@#include <linux/netfilter/x_tables.h> #include <net/netfilter/nf_conntrack.h> +MODULE_DESCRIPTION ("Xtables: Disabling connection tracking for packets" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_NOTRACK" );MODULE_ALIAS ("ip6t_NOTRACK" );
net/netfilter/xt_RATEEST.c +1 -1
@@ -197,7 +197,7 @@ static void __exit xt_rateest_tg_fini(void)MODULE_AUTHOR ("Patrick McHardy <[email protected]>" );MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("xtables rate estimator" ); +MODULE_DESCRIPTION ("Xtables: packet rate estimator" );MODULE_ALIAS ("ipt_RATEEST" );MODULE_ALIAS ("ip6t_RATEEST" );module_init (xt_rateest_tg_init);
net/netfilter/xt_SECMARK.c +1 -1
@@ -20,7 +20,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("James Morris <[email protected]>" ); -MODULE_DESCRIPTION ("ip[6]tables SECMARK modification module" ); +MODULE_DESCRIPTION ("Xtables: packet security mark modification" );MODULE_ALIAS ("ipt_SECMARK" );MODULE_ALIAS ("ip6t_SECMARK" );
net/netfilter/xt_TCPMSS.c +1 -1
@@ -24,7 +24,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Marc Boucher <[email protected]>" ); -MODULE_DESCRIPTION ("x_tables TCP MSS modification module" ); +MODULE_DESCRIPTION ("Xtables: TCP Maximum Segment Size (MSS) adjustment" );MODULE_ALIAS ("ipt_TCPMSS" );MODULE_ALIAS ("ip6t_TCPMSS" );
net/netfilter/xt_TCPOPTSTRIP.c +1 -1
@@ -141,7 +141,7 @@ static void __exit tcpoptstrip_tg_exit(void)module_init (tcpoptstrip_tg_init);module_exit (tcpoptstrip_tg_exit);MODULE_AUTHOR ("Sven Schnelle <[email protected]>, Jan Engelhardt <[email protected]>" ); -MODULE_DESCRIPTION ("netfilter \"TCPOPTSTRIP\" target module" ); +MODULE_DESCRIPTION ("Xtables: TCP option stripping" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_TCPOPTSTRIP" );MODULE_ALIAS ("ip6t_TCPOPTSTRIP" );
net/netfilter/xt_TRACE.c +1 -0
@@ -5,6 +5,7 @@#include <linux/netfilter/x_tables.h> +MODULE_DESCRIPTION ("Xtables: packet flow tracing" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_TRACE" );MODULE_ALIAS ("ip6t_TRACE" );
net/netfilter/xt_comment.c +1 -1
@@ -10,7 +10,7 @@#include <linux/netfilter/xt_comment.h> MODULE_AUTHOR ("Brad Fisher <[email protected]>" ); -MODULE_DESCRIPTION ("iptables comment match module" ); +MODULE_DESCRIPTION ("Xtables: No-op match which can be tagged with a comment" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_comment" );MODULE_ALIAS ("ip6t_comment" );
net/netfilter/xt_connbytes.c +1 -1
@@ -12,7 +12,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("iptables match for matching number of pkts/bytes per connection" ); +MODULE_DESCRIPTION ("Xtables: Number of packets/bytes per connection matching" );MODULE_ALIAS ("ipt_connbytes" );MODULE_ALIAS ("ip6t_connbytes" );
net/netfilter/xt_connlimit.c +1 -1
@@ -309,7 +309,7 @@ static void __exit connlimit_mt_exit(void)module_init (connlimit_mt_init);module_exit (connlimit_mt_exit);MODULE_AUTHOR ("Jan Engelhardt <[email protected]>" ); -MODULE_DESCRIPTION ("netfilter xt_connlimit match module" ); +MODULE_DESCRIPTION ("Xtables: Number of connections matching" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_connlimit" );MODULE_ALIAS ("ip6t_connlimit" );
net/netfilter/xt_connmark.c +1 -1
@@ -28,7 +28,7 @@#include <linux/netfilter/xt_connmark.h> MODULE_AUTHOR ("Henrik Nordstrom <[email protected]>" ); -MODULE_DESCRIPTION ("IP tables connmark match module" ); +MODULE_DESCRIPTION ("Xtables: connection mark match" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_connmark" );MODULE_ALIAS ("ip6t_connmark" );
net/netfilter/xt_conntrack.c +1 -1
@@ -20,7 +20,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Marc Boucher <[email protected]>" ); -MODULE_DESCRIPTION ("iptables connection tracking match module" ); +MODULE_DESCRIPTION ("Xtables: connection tracking state match" );MODULE_ALIAS ("ipt_conntrack" );MODULE_ALIAS ("ip6t_conntrack" );
net/netfilter/xt_dccp.c +1 -1
@@ -22,7 +22,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("Match for DCCP protocol packets" ); +MODULE_DESCRIPTION ("Xtables: DCCP protocol packet match" );MODULE_ALIAS ("ipt_dccp" );MODULE_ALIAS ("ip6t_dccp" );
net/netfilter/xt_dscp.c +1 -1
@@ -18,7 +18,7 @@#include <linux/netfilter_ipv4/ipt_tos.h> MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("x_tables DSCP/tos matching module" ); +MODULE_DESCRIPTION ("Xtables: DSCP/TOS field match" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_dscp" );MODULE_ALIAS ("ip6t_dscp" );
net/netfilter/xt_esp.c +1 -1
@@ -20,7 +20,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Yon Uriarte <[email protected]>" ); -MODULE_DESCRIPTION ("x_tables ESP SPI match module" ); +MODULE_DESCRIPTION ("Xtables: IPsec-ESP packet match" );MODULE_ALIAS ("ipt_esp" );MODULE_ALIAS ("ip6t_esp" );
net/netfilter/xt_hashlimit.c +1 -1
@@ -35,7 +35,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Harald Welte <[email protected]>" ); -MODULE_DESCRIPTION ("iptables match for limiting per hash-bucket" ); +MODULE_DESCRIPTION ("Xtables: per hash-bucket rate-limit match" );MODULE_ALIAS ("ipt_hashlimit" );MODULE_ALIAS ("ip6t_hashlimit" );
net/netfilter/xt_helper.c +1 -1
@@ -18,7 +18,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Martin Josefsson <[email protected]>" ); -MODULE_DESCRIPTION ("iptables helper match module" ); +MODULE_DESCRIPTION ("Xtables: Related connection matching" );MODULE_ALIAS ("ipt_helper" );MODULE_ALIAS ("ip6t_helper" );
net/netfilter/xt_length.c +1 -1
@@ -15,7 +15,7 @@#include <linux/netfilter/x_tables.h> MODULE_AUTHOR ("James Morris <[email protected]>" ); -MODULE_DESCRIPTION ("IP tables packet length matching module" ); +MODULE_DESCRIPTION ("Xtables: Packet length (Layer3,4,5) match" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_length" );MODULE_ALIAS ("ip6t_length" );
net/netfilter/xt_limit.c +1 -1
@@ -16,7 +16,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Herve Eychenne <[email protected]>" ); -MODULE_DESCRIPTION ("iptables rate limit match" ); +MODULE_DESCRIPTION ("Xtables: rate-limit match" );MODULE_ALIAS ("ipt_limit" );MODULE_ALIAS ("ip6t_limit" );
net/netfilter/xt_mac.c +1 -1
@@ -20,7 +20,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Netfilter Core Team <[email protected]>" ); -MODULE_DESCRIPTION ("iptables mac matching module" ); +MODULE_DESCRIPTION ("Xtables: MAC address match" );MODULE_ALIAS ("ipt_mac" );MODULE_ALIAS ("ip6t_mac" );
net/netfilter/xt_mark.c +1 -1
@@ -18,7 +18,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Marc Boucher <[email protected]>" ); -MODULE_DESCRIPTION ("iptables mark matching module" ); +MODULE_DESCRIPTION ("Xtables: packet mark match" );MODULE_ALIAS ("ipt_mark" );MODULE_ALIAS ("ip6t_mark" );
net/netfilter/xt_multiport.c +1 -1
@@ -22,7 +22,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Netfilter Core Team <[email protected]>" ); -MODULE_DESCRIPTION ("x_tables multiple port match module" ); +MODULE_DESCRIPTION ("Xtables: multiple port matching for TCP, UDP, UDP-Lite, SCTP and DCCP" );MODULE_ALIAS ("ipt_multiport" );MODULE_ALIAS ("ip6t_multiport" );
net/netfilter/xt_owner.c +1 -1
@@ -205,7 +205,7 @@ static void __exit owner_mt_exit(void)module_init (owner_mt_init);module_exit (owner_mt_exit);MODULE_AUTHOR ("Jan Engelhardt <[email protected]>" ); -MODULE_DESCRIPTION ("netfilter \"owner\" match module" ); +MODULE_DESCRIPTION ("Xtables: socket owner matching" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_owner" );MODULE_ALIAS ("ip6t_owner" );
net/netfilter/xt_physdev.c +1 -1
@@ -16,7 +16,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Bart De Schuymer <[email protected]>" ); -MODULE_DESCRIPTION ("iptables bridge physical device match module" ); +MODULE_DESCRIPTION ("Xtables: Bridge physical device match" );MODULE_ALIAS ("ipt_physdev" );MODULE_ALIAS ("ip6t_physdev" );
net/netfilter/xt_pkttype.c +1 -1
@@ -18,7 +18,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Michal Ludvig <[email protected]>" ); -MODULE_DESCRIPTION ("IP tables match to match on linklayer packet type" ); +MODULE_DESCRIPTION ("Xtables: link layer packet type match" );MODULE_ALIAS ("ipt_pkttype" );MODULE_ALIAS ("ip6t_pkttype" );
net/netfilter/xt_policy.c +1 -1
@@ -18,7 +18,7 @@#include <linux/netfilter/x_tables.h> MODULE_AUTHOR ("Patrick McHardy <[email protected]>" ); -MODULE_DESCRIPTION ("Xtables IPsec policy matching module" ); +MODULE_DESCRIPTION ("Xtables: IPsec policy match" );MODULE_LICENSE ("GPL" ); static inline bool
net/netfilter/xt_quota.c +1 -0
@@ -11,6 +11,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Sam Johnston <[email protected]>" ); +MODULE_DESCRIPTION ("Xtables: countdown quota match" );MODULE_ALIAS ("ipt_quota" );MODULE_ALIAS ("ip6t_quota" );
net/netfilter/xt_realm.c +1 -1
@@ -18,7 +18,7 @@MODULE_AUTHOR ("Sampsa Ranta <[email protected]>" );MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("X_tables realm match" ); +MODULE_DESCRIPTION ("Xtables: Routing realm match" );MODULE_ALIAS ("ipt_realm" ); static bool
net/netfilter/xt_sctp.c +1 -1
@@ -11,7 +11,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Kiran Kumar Immidi" ); -MODULE_DESCRIPTION ("Match for SCTP protocol packets" ); +MODULE_DESCRIPTION ("Xtables: SCTP protocol packet match" );MODULE_ALIAS ("ipt_sctp" );MODULE_ALIAS ("ip6t_sctp" );
net/netfilter/xt_statistic.c +1 -1
@@ -18,7 +18,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Patrick McHardy <[email protected]>" ); -MODULE_DESCRIPTION ("xtables statistical match module" ); +MODULE_DESCRIPTION ("Xtables: statistics-based matching (\"Nth\", random)" );MODULE_ALIAS ("ipt_statistic" );MODULE_ALIAS ("ip6t_statistic" );
net/netfilter/xt_string.c +1 -1
@@ -16,7 +16,7 @@#include <linux/textsearch.h> MODULE_AUTHOR ("Pablo Neira Ayuso <[email protected]>" ); -MODULE_DESCRIPTION ("IP tables string match module" ); +MODULE_DESCRIPTION ("Xtables: string-based matching" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_string" );MODULE_ALIAS ("ip6t_string" );
net/netfilter/xt_tcpmss.c +1 -1
@@ -20,7 +20,7 @@MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Marc Boucher <[email protected]>" ); -MODULE_DESCRIPTION ("iptables TCP MSS match module" ); +MODULE_DESCRIPTION ("Xtables: TCP MSS match" );MODULE_ALIAS ("ipt_tcpmss" );MODULE_ALIAS ("ip6t_tcpmss" );
net/netfilter/xt_tcpudp.c +1 -1
@@ -10,7 +10,7 @@#include <linux/netfilter_ipv4/ip_tables.h> #include <linux/netfilter_ipv6/ip6_tables.h> -MODULE_DESCRIPTION ("x_tables match for TCP and UDP(-Lite), supports IPv4 and IPv6" ); +MODULE_DESCRIPTION ("Xtables: TCP, UDP and UDP-Lite match" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("xt_tcp" );MODULE_ALIAS ("xt_udp" );
net/netfilter/xt_time.c +1 -1
@@ -264,7 +264,7 @@ static void __exit time_mt_exit(void)module_init (time_mt_init);module_exit (time_mt_exit);MODULE_AUTHOR ("Jan Engelhardt <[email protected]>" ); -MODULE_DESCRIPTION ("netfilter time match" ); +MODULE_DESCRIPTION ("Xtables: time-based matching" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_time" );MODULE_ALIAS ("ip6t_time" );
net/netfilter/xt_u32.c +1 -1
@@ -130,7 +130,7 @@ static void __exit u32_mt_exit(void)module_init (u32_mt_init);module_exit (u32_mt_exit);MODULE_AUTHOR ("Jan Engelhardt <[email protected]>" ); -MODULE_DESCRIPTION ("netfilter u32 match module" ); +MODULE_DESCRIPTION ("Xtables: arbitrary byte matching" );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("ipt_u32" );MODULE_ALIAS ("ip6t_u32" );
PATCH 17/38 : Rename ipt_iprange to xt_iprange
In reply to Patrick McHardy[NETFILTER]: Rename ipt_iprange to xt_iprange
This patch moves ipt_iprange to xt_iprange, in preparation for adding IPv6 support to xt_iprange.
---
commit bb44619d743106e32849e7a6d98464506c73f9f5
tree 82054d5467d270e3d18dbbbe29c7f9b948592662
parent 1834195893f1df31c850cf93281e4a88e2cfad9b
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:41 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:21 +0100
include/linux/netfilter/Kbuild | 1 + include/linux/netfilter/xt_iprange.h | 17 +++++++++++++++++ include/linux/netfilter_ipv4/ipt_iprange.h | 6 +----- net/ipv4/netfilter/Kconfig | 10 ---------- net/ipv4/netfilter/Makefile | 1 - net/netfilter/Kconfig | 11 +++++++++++ net/netfilter/Makefile | 1 + net/netfilter/xt_iprange.c | 27 +++++++++++++-------------- 8 files changed, 44 insertions(+), 30 deletions(-)
include/linux/netfilter/Kbuild +1 -0
@@ -21,6 +21,7 @@ header-y += xt_dccp.h header-y += xt_dscp.h header-y += xt_esp.h header-y += xt_hashlimit.h +header-y += xt_iprange.h header-y += xt_helper.h header-y += xt_length.h header-y += xt_limit.h
include/linux/netfilter/xt_iprange.h new file +17 -0
@@ -0,0 +1,17 @@ +#ifndef _LINUX_NETFILTER_XT_IPRANGE_H +#define _LINUX_NETFILTER_XT_IPRANGE_H 1 + +enum { +IPRANGE_SRC =1 <<0 ,/* match source IP address */ +IPRANGE_DST =1 <<1 ,/* match destination IP address */ +IPRANGE_SRC_INV =1 <<4 ,/* negate the condition */ +IPRANGE_DST_INV =1 <<5 ,/* -"- */ +}; + +struct xt_iprange_mtinfo { +union nf_inet_addr src_min, src_max; +union nf_inet_addr dst_min, dst_max; +u_int8_t flags; +}; + +#endif /* _LINUX_NETFILTER_XT_IPRANGE_H */
include/linux/netfilter_ipv4/ipt_iprange.h +1 -5
@@ -2,11 +2,7 @@#define _IPT_IPRANGE_H#include <linux/types.h> - -#define IPRANGE_SRC 0x01/* Match source IP address */ -#define IPRANGE_DST 0x02/* Match destination IP address */ -#define IPRANGE_SRC_INV 0x10/* Negate the condition */ -#define IPRANGE_DST_INV 0x20/* Negate the condition */ +#include <linux/netfilter/xt_iprange.h> struct ipt_iprange {/* Inclusive: network order. */
net/ipv4/netfilter/Kconfig +0 -10
@@ -57,16 +57,6 @@ config IP_NF_IPTABLES To compile it as a module, choose M here. If unsure, say N. # The matches. -config IP_NF_MATCH_IPRANGE - tristate '"iprange" match support' - depends on IP_NF_IPTABLES - depends on NETFILTER_ADVANCED - help - This option makes possible to match IP addresses against IP address - ranges. - - To compile it as a module, choose M here. If unsure, say N. - config IP_NF_MATCH_RECENT tristate '"recent" match support' depends on IP_NF_IPTABLES
net/ipv4/netfilter/Makefile +0 -1
@@ -44,7 +44,6 @@ obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o obj-$(CONFIG_IP_NF_MATCH_AH) += ipt_ah.o obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o -obj-$(CONFIG_IP_NF_MATCH_IPRANGE) += ipt_iprange.o obj-$(CONFIG_IP_NF_MATCH_RECENT) += ipt_recent.o obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o
net/netfilter/Kconfig +11 -0
@@ -567,6 +567,17 @@ config NETFILTER_XT_MATCH_HELPER To compile it as a module, choose M here. If unsure, say Y. +config NETFILTER_XT_MATCH_IPRANGE + tristate '"iprange" address range match support' + depends on NETFILTER_XTABLES + depends on NETFILTER_ADVANCED + ---help--- + This option adds a "iprange" match, which allows you to match based on + an IP address range. (Normal iptables only matches on single addresses + with an optional mask.) + + If unsure, say M. + config NETFILTER_XT_MATCH_LENGTH tristate '"length" match support' depends on NETFILTER_XTABLES
net/netfilter/Makefile +1 -0
@@ -63,6 +63,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o obj-$(CONFIG_NETFILTER_XT_MATCH_ESP) += xt_esp.o obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.o +obj-$(CONFIG_NETFILTER_XT_MATCH_IPRANGE) += xt_iprange.o obj-$(CONFIG_NETFILTER_XT_MATCH_LENGTH) += xt_length.o obj-$(CONFIG_NETFILTER_XT_MATCH_LIMIT) += xt_limit.o obj-$(CONFIG_NETFILTER_XT_MATCH_MAC) += xt_mac.o
net/netfilter/xt_iprange.c renamed from net/ipv4/netfilter/ipt_iprange.c +13 -14
@@ -1,11 +1,11 @@/* -* iptables module to match IP address ranges +* xt_iprange - Netfilter module to match IP address ranges * -* (C) 2003 Jozsef Kadlecsik <[email protected]> +* (C) 2003 Jozsef Kadlecsik <[email protected]> * -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. */ #include <linux/module.h> #include <linux/skbuff.h>
@@ -13,15 +13,11 @@#include <linux/netfilter/x_tables.h> #include <linux/netfilter_ipv4/ipt_iprange.h> -MODULE_LICENSE ("GPL" ); -MODULE_AUTHOR ("Jozsef Kadlecsik <[email protected]>" ); -MODULE_DESCRIPTION ("Xtables: arbitrary IPv4 range matching" ); -static bool -iprange_mt (const struct sk_buff *skb,const struct net_device *in, -const struct net_device *out,const struct xt_match *match, -const void *matchinfo,int offset,unsigned int protoff, -bool *hotdrop) +iprange_mt_v0 (const struct sk_buff *skb,const struct net_device *in, +const struct net_device *out,const struct xt_match *match, +const void *matchinfo,int offset,unsigned int protoff, +bool *hotdrop) {const struct ipt_iprange_info *info = matchinfo;const struct iphdr *iph =ip_hdr (skb);
@@ -58,7 +54,7 @@ iprange_mt(const struct sk_buff *skb, const struct net_device *in,static struct xt_match iprange_mt_reg__read_mostly = { .name ="iprange" , .family =AF_INET , - .match = iprange_mt, + .match = iprange_mt_v0, .matchsize =sizeof (struct ipt_iprange_info ), .me =THIS_MODULE };
@@ -75,3 +71,6 @@ static void __exit iprange_mt_exit(void)module_init (iprange_mt_init);module_exit (iprange_mt_exit); +MODULE_LICENSE ("GPL" ); +MODULE_AUTHOR ("Jozsef Kadlecsik <[email protected]>" ); +MODULE_DESCRIPTION ("Xtables: arbitrary IPv4 range matching" );
PATCH 18/38 : xt_iprange match, revision 1
In reply to Patrick McHardy[NETFILTER]: xt_iprange match, revision 1
Adds IPv6 support to xt_iprange, making it possible to match on IPv6 address ranges with ip6tables.
---
commit ba17e28b907c34daf0278e6c3c5d3413a3082649
tree 1f576e5bb0a1e44a911e0a7ddbcd11f9fcabc131
parent bb44619d743106e32849e7a6d98464506c73f9f5
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:43 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:22 +0100
net/netfilter/xt_iprange.c | 122 +++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 113 insertions(+), 9 deletions(-)
net/netfilter/xt_iprange.c +113 -9
@@ -2,6 +2,7 @@* xt_iprange - Netfilter module to match IP address ranges * * (C) 2003 Jozsef Kadlecsik <[email protected]> +* (C) CC Computer Consultants GmbH, 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as
@@ -10,6 +11,7 @@#include <linux/module.h> #include <linux/skbuff.h> #include <linux/ip.h> +#include <linux/ipv6.h> #include <linux/netfilter/x_tables.h> #include <linux/netfilter_ipv4/ipt_iprange.h>
@@ -51,26 +53,128 @@ iprange_mt_v0(const struct sk_buff *skb, const struct net_device *in,return true; } -static struct xt_match iprange_mt_reg__read_mostly = { - .name ="iprange" , - .family =AF_INET , - .match = iprange_mt_v0, - .matchsize =sizeof (struct ipt_iprange_info ), - .me =THIS_MODULE +static bool +iprange_mt4 (const struct sk_buff *skb,const struct net_device *in, +const struct net_device *out,const struct xt_match *match, +const void *matchinfo,int offset,unsigned int protoff, +bool *hotdrop) +{ +const struct xt_iprange_mtinfo *info = matchinfo; +const struct iphdr *iph =ip_hdr (skb); +bool m; + +if (info->flags &IPRANGE_SRC ) { + m =ntohl (iph->saddr) <ntohl (info->src_min.ip); + m |=ntohl (iph->saddr) >ntohl (info->src_max.ip); + m ^= info->flags &IPRANGE_SRC_INV ; +if (m) { +pr_debug ("src IP " NIPQUAD_FMT " NOT in range %s" +NIPQUAD_FMT "-" NIPQUAD_FMT "\n" , +NIPQUAD (iph->saddr), + (info->flags &IPRANGE_SRC_INV ) ?"(INV) " :"" , +NIPQUAD (info->src_max.ip), +NIPQUAD (info->src_max.ip)); +return false; + } + } +if (info->flags &IPRANGE_DST ) { + m =ntohl (iph->daddr) <ntohl (info->dst_min.ip); + m |=ntohl (iph->daddr) >ntohl (info->dst_max.ip); + m ^= info->flags &IPRANGE_DST_INV ; +if (m) { +pr_debug ("dst IP " NIPQUAD_FMT " NOT in range %s" +NIPQUAD_FMT "-" NIPQUAD_FMT "\n" , +NIPQUAD (iph->daddr), + (info->flags &IPRANGE_DST_INV ) ?"(INV) " :"" , +NIPQUAD (info->dst_min.ip), +NIPQUAD (info->dst_max.ip)); +return false; + } + } +return true; +} + +static inline int +iprange_ipv6_sub (const struct in6_addr *a,const struct in6_addr *b) +{ +unsigned int i; +int r; + +for (i =0 ; i <4 ; ++i) { + r = a->s6_addr32[i] - b->s6_addr32[i]; +if (r !=0 ) +return r; + } + +return 0 ; +} + +static bool +iprange_mt6 (const struct sk_buff *skb,const struct net_device *in, +const struct net_device *out,const struct xt_match *match, +const void *matchinfo,int offset,unsigned int protoff, +bool *hotdrop) +{ +const struct xt_iprange_mtinfo *info = matchinfo; +const struct ipv6hdr *iph =ipv6_hdr (skb); +bool m; + +if (info->flags &IPRANGE_SRC ) { + m =iprange_ipv6_sub (&iph->saddr, &info->src_min.in6) <0 ; + m |=iprange_ipv6_sub (&iph->saddr, &info->src_max.in6) >0 ; + m ^= info->flags &IPRANGE_SRC_INV ; +if (m) +return false; + } +if (info->flags &IPRANGE_DST ) { + m =iprange_ipv6_sub (&iph->daddr, &info->dst_min.in6) <0 ; + m |=iprange_ipv6_sub (&iph->daddr, &info->dst_max.in6) >0 ; + m ^= info->flags &IPRANGE_DST_INV ; +if (m) +return false; + } +return true; +} + +static struct xt_match iprange_mt_reg[]__read_mostly = { + { + .name ="iprange" , + .revision =0 , + .family =AF_INET , + .match = iprange_mt_v0, + .matchsize =sizeof (struct ipt_iprange_info ), + .me =THIS_MODULE , + }, + { + .name ="iprange" , + .revision =1 , + .family =AF_INET6 , + .match = iprange_mt4, + .matchsize =sizeof (struct xt_iprange_mtinfo ), + .me =THIS_MODULE , + }, + { + .name ="iprange" , + .revision =1 , + .family =AF_INET6 , + .match = iprange_mt6, + .matchsize =sizeof (struct xt_iprange_mtinfo ), + .me =THIS_MODULE , + }, };static int __init iprange_mt_init (void ) { -return xt_register_match (&iprange_mt_reg); +return xt_register_matches (iprange_mt_reg,ARRAY_SIZE (iprange_mt_reg)); } static void __exit iprange_mt_exit(void) { -xt_unregister_match (&iprange_mt_reg); +xt_unregister_matches (iprange_mt_reg,ARRAY_SIZE (iprange_mt_reg)); }module_init (iprange_mt_init);module_exit (iprange_mt_exit);MODULE_LICENSE ("GPL" ); -MODULE_AUTHOR ("Jozsef Kadlecsik <[email protected]>" ); +MODULE_AUTHOR ("Jozsef Kadlecsik <[email protected]>, Jan Engelhardt <[email protected]>" );MODULE_DESCRIPTION ("Xtables: arbitrary IPv4 range matching" );
PATCH 19/38 : Update feature-removal-schedule.txt
In reply to Patrick McHardy[NETFILTER]: Update feature-removal-schedule.txt
With all the newly introduced features, there is a lot to remove later on after a compatibility grace period of 2 years.
---
commit 733218e65d16da88f06073a62c017e6f9864ea1a
tree 5f55577f77ed3690b77302699c78b056db173a4b
parent ba17e28b907c34daf0278e6c3c5d3413a3082649
author Jan Engelhardt <[email protected]> Mon, 14 Jan 2008 06:51:44 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:23 +0100
Documentation/feature-removal-schedule.txt | 32 ++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-)
Documentation/feature-removal-schedule.txt +32 -0
@@ -340,3 +340,35 @@ Why: This algorithm was provided for reference but always exhibited bad responsiveness and performance and has some serious flaws. It has been replaced by rc80211-pid. Who: Stefano Brivio <[email protected]> + +--------------------------- + +What (Why): + - include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files + (superseded by xt_TOS/xt_tos target & match) + + - "forwarding" header files like ipt_mac.h in + include/linux/netfilter_ipv4/ and include/linux/netfilter_ipv6/ + + - xt_CONNMARK match revision 0 + (superseded by xt_CONNMARK match revision 1) + + - xt_MARK target revisions 0 and 1 + (superseded by xt_MARK match revision 2) + + - xt_connmark match revision 0 + (superseded by xt_connmark match revision 1) + + - xt_conntrack match revision 0 + (superseded by xt_conntrack match revision 1) + + - xt_iprange match revision 0, + include/linux/netfilter_ipv4/ipt_iprange.h + (superseded by xt_iprange match revision 1) + + - xt_mark match revision 0 + (superseded by xt_mark match revision 1) + +When: January 2009 or Linux 2.7.0, whichever comes first +Why: Superseded by newer revisions or modules +Who: Jan Engelhardt <[email protected]>
Re: [NETFILTER 19/38]: Update feature-removal-schedule.txt
Quoted 2 lines
With all the newly introduced features, there is a lot to remove later on after a compatibility grace period of 2 years.
...
Quoted 1 line
+When: January 2009 or Linux 2.7.0, whichever comes first
January 2009 is one year into the future though, not two.
Re: [NETFILTER 19/38]: Update feature-removal-schedule.txt
Quoted 6 lines · Jones Desougi
Quoted 2 lines
With all the newly introduced features, there is a lot to remove later on after a compatibility grace period of 2 years.
...
Quoted 1 line
+When: January 2009 or Linux 2.7.0, whichever comes first
January 2009 is one year into the future though, not two.
Yes, I noticed this myself. We can extend it if it seems to early at that time. But it can't hurt to announce a shorter timeframe :)
Re: [NETFILTER 19/38]: Update feature-removal-schedule.txt
Quoted 7 lines · Patrick McHardy
Quoted 6 lines · Jones Desougi
Quoted 2 lines
With all the newly introduced features, there is a lot to remove later on after a compatibility grace period of 2 years.
...
Quoted 1 line
+When: January 2009 or Linux 2.7.0, whichever comes first
January 2009 is one year into the future though, not two.
Integer overflow on my behalf :p
Quoted 2 lines
Yes, I noticed this myself. We can extend it if it seems to early at that time. But it can't hurt to announce a shorter timeframe :)
If the iptables patches get applied now (and a new version be released soon), an implicit 2 months extra time can be gained. That would also empty my patch queue there.
Re: [NETFILTER 19/38]: Update feature-removal-schedule.txt
Quoted 3 lines · Jan Engelhardt
If the iptables patches get applied now (and a new version be released soon), an implicit 2 months extra time can be gained. That would also empty my patch queue there.
The best way would be if you resend everything that is relevant to the patches merged upstream and stuff like the autoconf patches etc., so I don't have to wade through one or two month of old emails trying to figure out which patches to apply. I'll be slow applying things until Saturday though.
PATCH 20/38 : {ip,ip6}_tables: remove some inlines
In reply to Patrick McHardy[NETFILTER]: {ip,ip6}_tables: remove some inlines
This patch removes inlines except those which are used by packet matching code and thus are performance-critical.
Before:
$ size */*/*/ip*tables*.o text data bss dec hex filename 6402 500 16 6918 1b06 net/ipv4/netfilter/ip_tables.o 7130 500 16 7646 1dde net/ipv6/netfilter/ip6_tables.o
After:
$ size */*/*/ip*tables*.o text data bss dec hex filename 6307 500 16 6823 1aa7 net/ipv4/netfilter/ip_tables.o 7010 500 16 7526 1d66 net/ipv6/netfilter/ip6_tables.o
---
commit 672b1bb962284718abf7cc88055ca2bb4378c7bc
tree e7f3315a0d24d50219338934f3538172e404cae0
parent 733218e65d16da88f06073a62c017e6f9864ea1a
author Denys Vlasenko <[email protected]> Mon, 14 Jan 2008 06:51:46 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:23 +0100
net/ipv4/netfilter/ip_tables.c | 47 ++++++++++++++++++++++----------------- net/ipv6/netfilter/ip6_tables.c | 42 +++++++++++++++++++---------------- 2 files changed, 50 insertions(+), 39 deletions(-)
net/ipv4/netfilter/ip_tables.c +27 -20
@@ -75,6 +75,7 @@ do { \Hence the start of any table is given by get_table() below. */ /* Returns whether matches rule or not. */ +/* Performance critical - called for every packet */ static inline bool ip_packet_match(const struct iphdr *ip, const char *indev,
@@ -153,7 +154,7 @@ ip_packet_match(const struct iphdr *ip,return true; } -static inline bool +static bool ip_checkentry (const struct ipt_ip *ip) {if (ip->flags & ~IPT_F_MASK ) {
@@ -183,8 +184,9 @@ ipt_error(struct sk_buff *skb,return NF_DROP ; } -static inline -bool do_match(struct ipt_entry_match *m, +/* Performance critical - called for every packet */ +static inline bool +do_match(struct ipt_entry_match *m, const struct sk_buff *skb, const struct net_device *in, const struct net_device *out,
@@ -199,6 +201,7 @@ bool do_match(struct ipt_entry_match *m,return false; } +/* Performance critical */ static inline struct ipt_entry *get_entry (void *base,unsigned int offset) {
@@ -206,6 +209,7 @@ get_entry(void *base, unsigned int offset) }/* All zeroes == unconditional rule. */ +/* Mildly perf critical (only if packet tracing is on) */ static inline int unconditional (const struct ipt_ip *ip) {
@@ -221,7 +225,7 @@ unconditional(const struct ipt_ip *ip)#if defined(CONFIG_NETFILTER_XT_TARGET_TRACE ) || \ defined(CONFIG_NETFILTER_XT_TARGET_TRACE_MODULE ) -static const char *hooknames[] = { +static const char *const hooknames[] = { [NF_INET_PRE_ROUTING ] ="PREROUTING" , [NF_INET_LOCAL_IN ] ="INPUT" , [NF_INET_FORWARD] = "FORWARD",
@@ -235,7 +239,7 @@ enum nf_ip_trace_comments { NF_IP_TRACE_COMMENT_POLICY, }; -static const char *comments[] = { +static const char *const comments[] = { [NF_IP_TRACE_COMMENT_RULE ] ="rule" , [NF_IP_TRACE_COMMENT_RETURN ] ="return" , [NF_IP_TRACE_COMMENT_POLICY ] ="policy" ,
@@ -251,6 +255,7 @@ static struct nf_loginfo trace_loginfo = { }, }; +/* Mildly perf critical (only if packet tracing is on) */ static inline int get_chainname_rulenum(struct ipt_entry *s, struct ipt_entry *e, char *hookname, char **chainname,
@@ -567,7 +572,7 @@ mark_source_chains(struct xt_table_info *newinfo,return 1 ; } -static inline int +static int cleanup_match (struct ipt_entry_match *m,unsigned int *i) {if (i && (*i)-- ==0 )
@@ -579,7 +584,7 @@ cleanup_match(struct ipt_entry_match *m, unsigned int *i)return 0 ; } -static inline int +static int check_entry (struct ipt_entry *e,const char *name) {struct ipt_entry_target *t;
@@ -600,7 +605,8 @@ check_entry(struct ipt_entry *e, const char *name)return 0 ; } -static inline int check_match (struct ipt_entry_match *m,const char *name, +static int +check_match (struct ipt_entry_match *m,const char *name,const struct ipt_ip *ip,unsigned int hookmask,unsigned int *i) {
@@ -623,7 +629,7 @@ static inline int check_match(struct ipt_entry_match *m, const char *name,return ret; } -static inline int +static int find_check_match(struct ipt_entry_match *m, const char *name, const struct ipt_ip *ip,
@@ -652,7 +658,7 @@ err:return ret; } -static inline int check_target (struct ipt_entry *e,const char *name) +static int check_target (struct ipt_entry *e,const char *name) {struct ipt_entry_target *t;struct xt_target *target;
@@ -673,7 +679,7 @@ static inline int check_target(struct ipt_entry *e, const char *name)return ret; } -static inline int +static int find_check_entry (struct ipt_entry *e,const char *name,unsigned int size,unsigned int *i) {
@@ -717,7 +723,7 @@ find_check_entry(struct ipt_entry *e, const char *name, unsigned int size,return ret; } -static inline int +static int check_entry_size_and_hooks(struct ipt_entry *e, struct xt_table_info *newinfo, unsigned char *base,
@@ -760,7 +766,7 @@ check_entry_size_and_hooks(struct ipt_entry *e,return 0 ; } -static inline int +static int cleanup_entry (struct ipt_entry *e,unsigned int *i) {struct ipt_entry_target *t;
@@ -916,7 +922,7 @@ get_counters(const struct xt_table_info *t, } } -static inline struct xt_counters *alloc_counters (struct xt_table *table) +static struct xt_counters *alloc_counters (struct xt_table *table) {unsigned int countersize;struct xt_counters *counters;
@@ -1304,7 +1310,7 @@ do_replace(void __user *user, unsigned int len)/* We're lazy, and add to the first CPU; overflow works its fey magic * and everything is OK. */ -static inline int +static int add_counter_to_entry (struct ipt_entry *e,const struct xt_counters addme[],unsigned int *i)
@@ -1465,7 +1471,7 @@ out:return ret; } -static inline int +static int compat_find_calc_match(struct ipt_entry_match *m, const char *name, const struct ipt_ip *ip,
@@ -1489,7 +1495,7 @@ compat_find_calc_match(struct ipt_entry_match *m,return 0 ; } -static inline int +static int compat_release_match (struct ipt_entry_match *m,unsigned int *i) {if (i && (*i)-- ==0 )
@@ -1499,7 +1505,7 @@ compat_release_match(struct ipt_entry_match *m, unsigned int *i)return 0 ; } -static inline int +static int compat_release_entry (struct compat_ipt_entry *e,unsigned int *i) {struct ipt_entry_target *t;
@@ -1514,7 +1520,7 @@ compat_release_entry(struct compat_ipt_entry *e, unsigned int *i)return 0 ; } -static inline int +static int check_compat_entry_size_and_hooks(struct compat_ipt_entry *e, struct xt_table_info *newinfo, unsigned int *size,
@@ -1637,7 +1643,8 @@ compat_copy_entry_from_user(struct compat_ipt_entry *e, void **dstptr,return ret; } -static inline int compat_check_entry (struct ipt_entry *e,const char *name, +static int +compat_check_entry (struct ipt_entry *e,const char *name,unsigned int *i) {int j, ret;
net/ipv6/netfilter/ip6_tables.c +23 -19
168 lines not on this page · raw message
PATCH 21/38 : ipt_REJECT: properly handle IP options
In reply to Patrick McHardy[NETFILTER]: ipt_REJECT: properly handle IP options
The current TCP RST construction reuses the old packet and can't deal with IP options as a consequence of that. Construct the RST from scratch instead.
---
commit e98b968b91b444bb9af1547818b9601419150dba
tree ce141bf2b369601e6160e59b9adae3449887ee34
parent 672b1bb962284718abf7cc88055ca2bb4378c7bc
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:24 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:24 +0100
net/ipv4/netfilter/ipt_REJECT.c | 102 ++++++++++++++------------------------- 1 files changed, 37 insertions(+), 65 deletions(-)
net/ipv4/netfilter/ipt_REJECT.c +37 -65
@@ -35,11 +35,8 @@ MODULE_DESCRIPTION("Xtables: packet \"rejection\" target for IPv4");static void send_reset (struct sk_buff *oldskb,int hook) {struct sk_buff *nskb; -struct iphdr *niph; +struct iphdr *oiph, *niph;struct tcphdr _otcph, *oth, *tcph; -__be16 tmp_port; -__be32 tmp_addr; -int needs_ack;unsigned int addr_type;/* IP header checks: fragment. */
@@ -58,69 +55,47 @@ static void send_reset(struct sk_buff *oldskb, int hook)/* Check checksum */ if (nf_ip_checksum (oldskb, hook,ip_hdrlen (oldskb),IPPROTO_TCP ))return ; + oiph =ip_hdr (oldskb); -/* We need a linear, writeable skb. We also need to expand -headroom in case hh_len of incoming interface < hh_len of -outgoing interface */ - nskb =skb_copy_expand (oldskb,LL_MAX_HEADER ,skb_tailroom (oldskb), -GFP_ATOMIC ); + nskb =alloc_skb (sizeof (struct iphdr ) +sizeof (struct tcphdr ) + +LL_MAX_HEADER ,GFP_ATOMIC );if (!nskb)return ; -/* This packet will not be the same as the other: clear nf fields */ -nf_reset (nskb); - nskb->mark =0 ; -skb_init_secmark (nskb); - -skb_shinfo (nskb)->gso_size =0 ; -skb_shinfo (nskb)->gso_segs =0 ; -skb_shinfo (nskb)->gso_type =0 ; - - tcph = (struct tcphdr *)(skb_network_header (nskb) +ip_hdrlen (nskb)); - -/* Swap source and dest */ - niph =ip_hdr (nskb); - tmp_addr = niph->saddr; - niph->saddr = niph->daddr; - niph->daddr = tmp_addr; - tmp_port = tcph->source; - tcph->source = tcph->dest; - tcph->dest = tmp_port; - -/* Truncate to length (no data) */ - tcph->doff =sizeof (struct tcphdr )/4 ; -skb_trim (nskb,ip_hdrlen (nskb) +sizeof (struct tcphdr )); - -if (tcph->ack) { - needs_ack =0 ; +skb_reserve (nskb,LL_MAX_HEADER ); + +skb_reset_network_header (nskb); + niph = (struct iphdr *)skb_put (nskb,sizeof (struct iphdr )); + niph->version =4 ; + niph->ihl =sizeof (struct iphdr ) /4 ; + niph->tos =0 ; + niph->id =0 ; + niph->frag_off =htons (IP_DF ); + niph->protocol =IPPROTO_TCP ; + niph->check =0 ; + niph->saddr = oiph->daddr; + niph->daddr = oiph->saddr; + + tcph = (struct tcphdr *)skb_put (nskb,sizeof (struct tcphdr )); +memset (tcph,0 ,sizeof (*tcph)); + tcph->source = oth->dest; + tcph->dest = oth->source; + tcph->doff =sizeof (struct tcphdr ) /4 ; + +if (oth->ack) tcph->seq = oth->ack_seq; - tcph->ack_seq =0 ; - }else { - needs_ack =1 ; +else { tcph->ack_seq =htonl (ntohl (oth->seq) + oth->syn + oth->fin + oldskb->len -ip_hdrlen (oldskb) - (oth->doff <<2 )); - tcph->seq =0 ; + tcph->ack =1 ; } -/* Reset flags */ - ((u_int8_t *)tcph)[13 ] =0 ; - tcph->rst =1 ; - tcph->ack = needs_ack; - - tcph->window =0 ; - tcph->urg_ptr =0 ; - -/* Adjust TCP checksum */ - tcph->check =0 ; - tcph->check =tcp_v4_check (sizeof (struct tcphdr ), - niph->saddr, niph->daddr, -csum_partial (tcph, -sizeof (struct tcphdr ),0 )); - -/* Set DF, id = 0 */ - niph->frag_off =htons (IP_DF ); - niph->id =0 ; + tcph->rst =1 ; + tcph->check =tcp_v4_check (sizeof (struct tcphdr ), + niph->saddr, niph->daddr, +csum_partial (tcph, +sizeof (struct tcphdr ),0 )); addr_type =RTN_UNSPEC ; if (hook != NF_INET_FORWARD
@@ -130,14 +105,16 @@ static void send_reset(struct sk_buff *oldskb, int hook) ) addr_type =RTN_LOCAL ; +/* ip_route_me_harder expects skb->dst to be set */ +dst_hold (oldskb->dst); + nskb->dst = oldskb->dst; +if (ip_route_me_harder (nskb, addr_type)) goto free_nskb; + niph->ttl =dst_metric (nskb->dst,RTAX_HOPLIMIT ); nskb->ip_summed =CHECKSUM_NONE ; -/* Adjust IP TTL */ - niph->ttl =dst_metric (nskb->dst,RTAX_HOPLIMIT ); -/* "Never happens" */ if (nskb->len >dst_mtu (nskb->dst)) goto free_nskb;
@@ -163,11 +140,6 @@ reject_tg(struct sk_buff *skb, const struct net_device *in, {const struct ipt_reject_info *reject = targinfo; -/* Our naive response construction doesn't deal with IP -options, and probably shouldn't try. */ -if (ip_hdrlen (skb) !=sizeof (struct iphdr )) -return NF_DROP ; -/* WARNING: This code causes reentry within iptables. This means that the iptables jump stack is now crap. We must return an absolute verdict. --RR */
PATCH 22/38 : nf_conntrack_{tcp,sctp}: mark state table const
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_{tcp,sctp}: mark state table const
---
commit 644ca177a54fc8a0e3745955475cccad5c799aae
tree db5a1a2d5518c94a46a898c02c71a0d800e874b6
parent e98b968b91b444bb9af1547818b9601419150dba
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:24 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:24 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 2 +- net/netfilter/nf_conntrack_proto_tcp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +1 -1
@@ -110,7 +110,7 @@ cookie echoed to closed.*/ /* SCTP conntrack state transitions */ -static enum sctp_conntrack sctp_conntracks[2 ][9 ][SCTP_CONNTRACK_MAX ] = { +static const enum sctp_conntrack sctp_conntracks[2 ][9 ][SCTP_CONNTRACK_MAX ] = { {/* ORIGINAL */ /* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA */
net/netfilter/nf_conntrack_proto_tcp.c +1 -1
@@ -149,7 +149,7 @@ enum tcp_bit_set {* if they are invalid * or we do not support the request (simultaneous open) */ -static enum tcp_conntrack tcp_conntracks[2 ][6 ][TCP_CONNTRACK_MAX ] = { +static const enum tcp_conntrack tcp_conntracks[2 ][6 ][TCP_CONNTRACK_MAX ] = { {/* ORIGINAL */ /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */
PATCH 23/38 : nf_conntrack_{tcp,sctp}: shrink state table
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_{tcp,sctp}: shrink state table
The TCP and SCTP conntrack state transition tables only holds small numbers, but gcc uses 4 byte per entry for the enum. Switching to an u8 reduces the size from 480 to 120 bytes for TCP and from 576 to 144 bytes for SCTP.
---
commit 310e65023fa9efc6b18c32f3146cc6c24e6b2c33
tree 1cbfef8fbfb6372a12d204531c8b3a83c8f85c3f
parent 644ca177a54fc8a0e3745955475cccad5c799aae
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:25 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:25 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 2 +- net/netfilter/nf_conntrack_proto_tcp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +1 -1
@@ -110,7 +110,7 @@ cookie echoed to closed.*/ /* SCTP conntrack state transitions */ -static const enum sctp_conntrack sctp_conntracks[2 ][9 ][SCTP_CONNTRACK_MAX ] = { +static const u8 sctp_conntracks[2 ][9 ][SCTP_CONNTRACK_MAX ] = { {/* ORIGINAL */ /* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA */
net/netfilter/nf_conntrack_proto_tcp.c +1 -1
@@ -149,7 +149,7 @@ enum tcp_bit_set {* if they are invalid * or we do not support the request (simultaneous open) */ -static const enum tcp_conntrack tcp_conntracks[2 ][6 ][TCP_CONNTRACK_MAX ] = { +static const u8 tcp_conntracks[2 ][6 ][TCP_CONNTRACK_MAX ] = { {/* ORIGINAL */ /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */
PATCH 24/38 : nf_conntrack_tcp: remove timeout indirection
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_tcp: remove timeout indirection
Instead of keeping pointers to the timeout values in a table, simply put the timeout values in the table directly.
---
commit e11744f0b9408e74f920463e52d59460e9c2b2b2
tree 7a75dea3fedc59c8ae32106fb1aae3a95bf3dfe9
parent 310e65023fa9efc6b18c32f3146cc6c24e6b2c33
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:25 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:25 +0100
net/netfilter/nf_conntrack_proto_tcp.c | 67 +++++++++++++------------------- 1 files changed, 28 insertions(+), 39 deletions(-)
net/netfilter/nf_conntrack_proto_tcp.c +28 -39
@@ -64,32 +64,21 @@ static const char *tcp_conntrack_names[] = {#define HOURS * 60 MINS#define DAYS * 24 HOURS -static unsigned int nf_ct_tcp_timeout_syn_sent __read_mostly = 2 MINS; -static unsigned int nf_ct_tcp_timeout_syn_recv __read_mostly = 60 SECS; -static unsigned int nf_ct_tcp_timeout_established __read_mostly = 5 DAYS; -static unsigned int nf_ct_tcp_timeout_fin_wait __read_mostly = 2 MINS; -static unsigned int nf_ct_tcp_timeout_close_wait __read_mostly = 60 SECS; -static unsigned int nf_ct_tcp_timeout_last_ack __read_mostly = 30 SECS; -static unsigned int nf_ct_tcp_timeout_time_wait __read_mostly = 2 MINS; -static unsigned int nf_ct_tcp_timeout_close __read_mostly = 10 SECS; -/* RFC1122 says the R2 limit should be at least 100 seconds. Linux uses 15 packets as limit, which corresponds to ~13-30min depending on RTO. */ static unsigned int nf_ct_tcp_timeout_max_retrans __read_mostly = 5 MINS; -static unsigned int * tcp_timeouts[] = { -NULL ,/* TCP_CONNTRACK_NONE */ - &nf_ct_tcp_timeout_syn_sent,/* TCP_CONNTRACK_SYN_SENT, */ - &nf_ct_tcp_timeout_syn_recv,/* TCP_CONNTRACK_SYN_RECV, */ - &nf_ct_tcp_timeout_established,/* TCP_CONNTRACK_ESTABLISHED, */ - &nf_ct_tcp_timeout_fin_wait,/* TCP_CONNTRACK_FIN_WAIT, */ - &nf_ct_tcp_timeout_close_wait,/* TCP_CONNTRACK_CLOSE_WAIT, */ - &nf_ct_tcp_timeout_last_ack,/* TCP_CONNTRACK_LAST_ACK, */ - &nf_ct_tcp_timeout_time_wait,/* TCP_CONNTRACK_TIME_WAIT, */ - &nf_ct_tcp_timeout_close,/* TCP_CONNTRACK_CLOSE, */ -NULL ,/* TCP_CONNTRACK_LISTEN */ - }; +static unsigned int tcp_timeouts[TCP_CONNTRACK_MAX ]__read_mostly = { + [TCP_CONNTRACK_SYN_SENT] = 2 MINS, + [TCP_CONNTRACK_SYN_RECV] = 60 SECS, + [TCP_CONNTRACK_ESTABLISHED] = 5 DAYS, + [TCP_CONNTRACK_FIN_WAIT] = 2 MINS, + [TCP_CONNTRACK_CLOSE_WAIT] = 60 SECS, + [TCP_CONNTRACK_LAST_ACK] = 30 SECS, + [TCP_CONNTRACK_TIME_WAIT] = 2 MINS, + [TCP_CONNTRACK_CLOSE] = 10 SECS, +};#define sNO TCP_CONNTRACK_NONE#define sSS TCP_CONNTRACK_SYN_SENT
@@ -941,8 +930,8 @@ static int tcp_packet(struct nf_conn *conntrack, || new_state == TCP_CONNTRACK_CLOSE)) conntrack->proto.tcp.seen[dir].flags |=IP_CT_TCP_FLAG_CLOSE_INIT ; timeout = conntrack->proto.tcp.retrans >= nf_ct_tcp_max_retrans - && *tcp_timeouts[new_state] > nf_ct_tcp_timeout_max_retrans - ? nf_ct_tcp_timeout_max_retrans : *tcp_timeouts[new_state]; + && tcp_timeouts[new_state] > nf_ct_tcp_timeout_max_retrans + ? nf_ct_tcp_timeout_max_retrans : tcp_timeouts[new_state];write_unlock_bh (&tcp_lock);nf_conntrack_event_cache (IPCT_PROTOINFO_VOLATILE , skb);
@@ -1163,56 +1152,56 @@ static struct ctl_table_header *tcp_sysctl_header;static struct ctl_table tcp_sysctl_table[] = { { .procname ="nf_conntrack_tcp_timeout_syn_sent" , - .data = &nf_ct_tcp_timeout_syn_sent, + .data = &tcp_timeouts[TCP_CONNTRACK_SYN_SENT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_tcp_timeout_syn_recv" , - .data = &nf_ct_tcp_timeout_syn_recv, + .data = &tcp_timeouts[TCP_CONNTRACK_SYN_RECV ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_tcp_timeout_established" , - .data = &nf_ct_tcp_timeout_established, + .data = &tcp_timeouts[TCP_CONNTRACK_ESTABLISHED ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_tcp_timeout_fin_wait" , - .data = &nf_ct_tcp_timeout_fin_wait, + .data = &tcp_timeouts[TCP_CONNTRACK_FIN_WAIT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_tcp_timeout_close_wait" , - .data = &nf_ct_tcp_timeout_close_wait, + .data = &tcp_timeouts[TCP_CONNTRACK_CLOSE_WAIT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_tcp_timeout_last_ack" , - .data = &nf_ct_tcp_timeout_last_ack, + .data = &tcp_timeouts[TCP_CONNTRACK_LAST_ACK ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_tcp_timeout_time_wait" , - .data = &nf_ct_tcp_timeout_time_wait, + .data = &tcp_timeouts[TCP_CONNTRACK_TIME_WAIT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_tcp_timeout_close" , - .data = &nf_ct_tcp_timeout_close, + .data = &tcp_timeouts[TCP_CONNTRACK_CLOSE ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies,
@@ -1257,56 +1246,56 @@ static struct ctl_table tcp_sysctl_table[] = {static struct ctl_table tcp_compat_sysctl_table[] = { { .procname ="ip_conntrack_tcp_timeout_syn_sent" , - .data = &nf_ct_tcp_timeout_syn_sent, + .data = &tcp_timeouts[TCP_CONNTRACK_SYN_SENT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_tcp_timeout_syn_recv" , - .data = &nf_ct_tcp_timeout_syn_recv, + .data = &tcp_timeouts[TCP_CONNTRACK_SYN_RECV ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_tcp_timeout_established" , - .data = &nf_ct_tcp_timeout_established, + .data = &tcp_timeouts[TCP_CONNTRACK_ESTABLISHED ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_tcp_timeout_fin_wait" , - .data = &nf_ct_tcp_timeout_fin_wait, + .data = &tcp_timeouts[TCP_CONNTRACK_FIN_WAIT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_tcp_timeout_close_wait" , - .data = &nf_ct_tcp_timeout_close_wait, + .data = &tcp_timeouts[TCP_CONNTRACK_CLOSE_WAIT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_tcp_timeout_last_ack" , - .data = &nf_ct_tcp_timeout_last_ack, + .data = &tcp_timeouts[TCP_CONNTRACK_LAST_ACK ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_tcp_timeout_time_wait" , - .data = &nf_ct_tcp_timeout_time_wait, + .data = &tcp_timeouts[TCP_CONNTRACK_TIME_WAIT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_tcp_timeout_close" , - .data = &nf_ct_tcp_timeout_close, + .data = &tcp_timeouts[TCP_CONNTRACK_CLOSE ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies,
PATCH 25/38 : nf_conntrack_sctp: basic cleanups
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_sctp: basic cleanups
Reindent switch cases properly, get rid of weird constructs like "!(x == y)", put logical operations on the end of the line instead of the next line, get rid of superfluous braces.
---
commit 2138af0660d4043c80aa13caa07e50ebeb1996d9
tree 4bebb98df91217146aea4a55f4df6ed84122addd
parent e11744f0b9408e74f920463e52d59460e9c2b2b2
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:26 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:26 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 140 ++++++++++++++++--------------- 1 files changed, 72 insertions(+), 68 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +72 -68
@@ -206,28 +206,26 @@ static int do_basic_checks(struct nf_conn *conntrack, for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) {pr_debug ("Chunk Num: %d Type: %d\n" , count, sch->type); -if (sch->type ==SCTP_CID_INIT - || sch->type ==SCTP_CID_INIT_ACK - || sch->type ==SCTP_CID_SHUTDOWN_COMPLETE ) { +if (sch->type ==SCTP_CID_INIT || + sch->type ==SCTP_CID_INIT_ACK || + sch->type ==SCTP_CID_SHUTDOWN_COMPLETE ) flag =1 ; - }/* * Cookie Ack/Echo chunks not the first OR * Init / Init Ack / Shutdown compl chunks not the only chunks * OR zero-length. */ -if (((sch->type ==SCTP_CID_COOKIE_ACK - || sch->type ==SCTP_CID_COOKIE_ECHO - || flag) - && count !=0 ) || !sch->length) { +if (((sch->type ==SCTP_CID_COOKIE_ACK || + sch->type ==SCTP_CID_COOKIE_ECHO || + flag) && + count !=0 ) || !sch->length) {pr_debug ("Basic checks failed\n" );return 1 ; } -if (map) { +if (map)set_bit (sch->type, (void *)map); - } }pr_debug ("Basic checks passed\n" );
@@ -243,39 +241,48 @@ static int new_state(enum ip_conntrack_dir dir,pr_debug ("Chunk type: %d\n" , chunk_type);switch (chunk_type) { -case SCTP_CID_INIT : -pr_debug ("SCTP_CID_INIT\n" ); - i =0 ;break ; -case SCTP_CID_INIT_ACK : -pr_debug ("SCTP_CID_INIT_ACK\n" ); - i =1 ;break ; -case SCTP_CID_ABORT : -pr_debug ("SCTP_CID_ABORT\n" ); - i =2 ;break ; -case SCTP_CID_SHUTDOWN : -pr_debug ("SCTP_CID_SHUTDOWN\n" ); - i =3 ;break ; -case SCTP_CID_SHUTDOWN_ACK : -pr_debug ("SCTP_CID_SHUTDOWN_ACK\n" ); - i =4 ;break ; -case SCTP_CID_ERROR : -pr_debug ("SCTP_CID_ERROR\n" ); - i =5 ;break ; -case SCTP_CID_COOKIE_ECHO : -pr_debug ("SCTP_CID_COOKIE_ECHO\n" ); - i =6 ;break ; -case SCTP_CID_COOKIE_ACK : -pr_debug ("SCTP_CID_COOKIE_ACK\n" ); - i =7 ;break ; -case SCTP_CID_SHUTDOWN_COMPLETE : -pr_debug ("SCTP_CID_SHUTDOWN_COMPLETE\n" ); - i =8 ;break ; -default : -/* Other chunks like DATA, SACK, HEARTBEAT and -its ACK do not cause a change in state */ -pr_debug ("Unknown chunk type, Will stay in %s\n" , - sctp_conntrack_names[cur_state]); -return cur_state; +case SCTP_CID_INIT : +pr_debug ("SCTP_CID_INIT\n" ); + i =0 ; +break ; +case SCTP_CID_INIT_ACK : +pr_debug ("SCTP_CID_INIT_ACK\n" ); + i =1 ; +break ; +case SCTP_CID_ABORT : +pr_debug ("SCTP_CID_ABORT\n" ); + i =2 ; +break ; +case SCTP_CID_SHUTDOWN : +pr_debug ("SCTP_CID_SHUTDOWN\n" ); + i =3 ; +break ; +case SCTP_CID_SHUTDOWN_ACK : +pr_debug ("SCTP_CID_SHUTDOWN_ACK\n" ); + i =4 ; +break ; +case SCTP_CID_ERROR : +pr_debug ("SCTP_CID_ERROR\n" ); + i =5 ; +break ; +case SCTP_CID_COOKIE_ECHO : +pr_debug ("SCTP_CID_COOKIE_ECHO\n" ); + i =6 ; +break ; +case SCTP_CID_COOKIE_ACK : +pr_debug ("SCTP_CID_COOKIE_ACK\n" ); + i =7 ; +break ; +case SCTP_CID_SHUTDOWN_COMPLETE : +pr_debug ("SCTP_CID_SHUTDOWN_COMPLETE\n" ); + i =8 ; +break ; +default : +/* Other chunks like DATA, SACK, HEARTBEAT and +its ACK do not cause a change in state */ +pr_debug ("Unknown chunk type, Will stay in %s\n" , + sctp_conntrack_names[cur_state]); +return cur_state; } pr_debug("dir: %d cur_state: %s chunk_type: %d new_state: %s\n",
@@ -307,12 +314,12 @@ static int sctp_packet(struct nf_conn *conntrack,return -1 ;/* Check the verification tag (Sec 8.5) */ -if (!test_bit (SCTP_CID_INIT , (void *)map) - && !test_bit (SCTP_CID_SHUTDOWN_COMPLETE , (void *)map) - && !test_bit (SCTP_CID_COOKIE_ECHO , (void *)map) - && !test_bit (SCTP_CID_ABORT , (void *)map) - && !test_bit (SCTP_CID_SHUTDOWN_ACK , (void *)map) - && (sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)])) { +if (!test_bit (SCTP_CID_INIT , (void *)map) && + !test_bit (SCTP_CID_SHUTDOWN_COMPLETE , (void *)map) && + !test_bit (SCTP_CID_COOKIE_ECHO , (void *)map) && + !test_bit (SCTP_CID_ABORT , (void *)map) && + !test_bit (SCTP_CID_SHUTDOWN_ACK , (void *)map) && + sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)]) {pr_debug ("Verification tag check failed\n" );return -1 ; }
@@ -330,24 +337,22 @@ static int sctp_packet(struct nf_conn *conntrack, } }else if (sch->type ==SCTP_CID_ABORT ) {/* Sec 8.5.1 (B) */ -if (!(sh->vtag == conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)]) - && !(sh->vtag == conntrack->proto.sctp.vtag - [1 -CTINFO2DIR (ctinfo)])) { +if (sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)] && + sh->vtag != conntrack->proto.sctp.vtag[1 -CTINFO2DIR (ctinfo)]) {write_unlock_bh (&sctp_lock);return -1 ; } }else if (sch->type ==SCTP_CID_SHUTDOWN_COMPLETE ) {/* Sec 8.5.1 (C) */ -if (!(sh->vtag == conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)]) - && !(sh->vtag == conntrack->proto.sctp.vtag - [1 -CTINFO2DIR (ctinfo)] - && (sch->flags &1 ))) { +if (sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)] && + sh->vtag != conntrack->proto.sctp.vtag[1 -CTINFO2DIR (ctinfo)] && + (sch->flags &1 )) {write_unlock_bh (&sctp_lock);return -1 ; } }else if (sch->type ==SCTP_CID_COOKIE_ECHO ) {/* Sec 8.5.1 (D) */ -if (!(sh->vtag == conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)])) { +if (sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)]) {write_unlock_bh (&sctp_lock);return -1 ; }
@@ -366,15 +371,15 @@ static int sctp_packet(struct nf_conn *conntrack, }/* If it is an INIT or an INIT ACK note down the vtag */ -if (sch->type ==SCTP_CID_INIT - || sch->type ==SCTP_CID_INIT_ACK ) { +if (sch->type ==SCTP_CID_INIT || + sch->type ==SCTP_CID_INIT_ACK ) {sctp_inithdr_t _inithdr, *ih; ih =skb_header_pointer (skb, offset +sizeof (sctp_chunkhdr_t),sizeof (_inithdr), &_inithdr);if (ih ==NULL ) { -write_unlock_bh (&sctp_lock); -return -1 ; +write_unlock_bh (&sctp_lock); +return -1 ; }pr_debug ("Setting vtag %x for dir %d\n" , ih->init_tag, !CTINFO2DIR (ctinfo));
@@ -389,9 +394,9 @@ static int sctp_packet(struct nf_conn *conntrack,nf_ct_refresh_acct (conntrack, ctinfo, skb, *sctp_timeouts[newconntrack]); -if (oldsctpstate ==SCTP_CONNTRACK_COOKIE_ECHOED - &&CTINFO2DIR (ctinfo) ==IP_CT_DIR_REPLY - && newconntrack ==SCTP_CONNTRACK_ESTABLISHED ) { +if (oldsctpstate ==SCTP_CONNTRACK_COOKIE_ECHOED && +CTINFO2DIR (ctinfo) ==IP_CT_DIR_REPLY && + newconntrack ==SCTP_CONNTRACK_ESTABLISHED ) {pr_debug ("Setting assured bit\n" );set_bit (IPS_ASSURED_BIT , &conntrack->status);nf_conntrack_event_cache (IPCT_STATUS , skb);
@@ -418,11 +423,10 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,return 0 ;/* If an OOTB packet has any of these chunks discard (Sec 8.4) */ -if ((test_bit (SCTP_CID_ABORT , (void *)map)) - || (test_bit (SCTP_CID_SHUTDOWN_COMPLETE , (void *)map)) - || (test_bit (SCTP_CID_COOKIE_ACK , (void *)map))) { +if (test_bit (SCTP_CID_ABORT , (void *)map) || +test_bit (SCTP_CID_SHUTDOWN_COMPLETE , (void *)map) || +test_bit (SCTP_CID_COOKIE_ACK , (void *)map))return 0 ; - } newconntrack =SCTP_CONNTRACK_MAX ; for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) {
PATCH 26/38 : nf_conntrack_sctp: use proper types for bitops
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_sctp: use proper types for bitops
Use unsigned long instead of char for the bitmap and removed lots of casts.
---
commit 7b4d31af2b7c66345df8c9147468076c6cb8ab8e
tree 6818c02035633d2a911a7fd414bea3009de56119
parent 2138af0660d4043c80aa13caa07e50ebeb1996d9
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:26 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:26 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +12 -12
@@ -195,7 +195,7 @@ for ((offset) = (dataoff) + sizeof(sctp_sctphdr_t), (count) = 0; \static int do_basic_checks (struct nf_conn *conntrack,const struct sk_buff *skb,unsigned int dataoff, -char *map) +unsigned long *map) {u_int32_t offset, count;sctp_chunkhdr_t _sch, *sch;
@@ -225,7 +225,7 @@ static int do_basic_checks(struct nf_conn *conntrack, }if (map) -set_bit (sch->type, (void *)map); +set_bit (sch->type, map); }pr_debug ("Basic checks passed\n" );
@@ -304,7 +304,7 @@ static int sctp_packet(struct nf_conn *conntrack,sctp_sctphdr_t _sctph, *sh;sctp_chunkhdr_t _sch, *sch;u_int32_t offset, count; -char map[256 /sizeof (char )] = {0 }; +unsigned long map[256 /sizeof (unsigned long )] = {0 }; sh =skb_header_pointer (skb, dataoff,sizeof (_sctph), &_sctph);if (sh ==NULL )
@@ -314,11 +314,11 @@ static int sctp_packet(struct nf_conn *conntrack,return -1 ;/* Check the verification tag (Sec 8.5) */ -if (!test_bit (SCTP_CID_INIT , (void *)map) && - !test_bit (SCTP_CID_SHUTDOWN_COMPLETE , (void *)map) && - !test_bit (SCTP_CID_COOKIE_ECHO , (void *)map) && - !test_bit (SCTP_CID_ABORT , (void *)map) && - !test_bit (SCTP_CID_SHUTDOWN_ACK , (void *)map) && +if (!test_bit (SCTP_CID_INIT , map) && + !test_bit (SCTP_CID_SHUTDOWN_COMPLETE , map) && + !test_bit (SCTP_CID_COOKIE_ECHO , map) && + !test_bit (SCTP_CID_ABORT , map) && + !test_bit (SCTP_CID_SHUTDOWN_ACK , map) && sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)]) {pr_debug ("Verification tag check failed\n" );return -1 ;
@@ -413,7 +413,7 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,sctp_sctphdr_t _sctph, *sh;sctp_chunkhdr_t _sch, *sch;u_int32_t offset, count; -char map[256 /sizeof (char )] = {0 }; +unsigned long map[256 /sizeof (unsigned long )] = {0 }; sh =skb_header_pointer (skb, dataoff,sizeof (_sctph), &_sctph);if (sh ==NULL )
@@ -423,9 +423,9 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,return 0 ;/* If an OOTB packet has any of these chunks discard (Sec 8.4) */ -if (test_bit (SCTP_CID_ABORT , (void *)map) || -test_bit (SCTP_CID_SHUTDOWN_COMPLETE , (void *)map) || -test_bit (SCTP_CID_COOKIE_ACK , (void *)map)) +if (test_bit (SCTP_CID_ABORT , map) || +test_bit (SCTP_CID_SHUTDOWN_COMPLETE , map) || +test_bit (SCTP_CID_COOKIE_ACK , map))return 0 ; newconntrack =SCTP_CONNTRACK_MAX ;
PATCH 27/38 : nf_conntrack_sctp: reduce line length
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_sctp: reduce line length
Reduce the length of some overly long lines by renaming all "conntrack" variables to "ct".
---
commit 1880ca6a51b7d8404a574db37e9fe1ad4349a580
tree fca5c1d067d27d65a9013be777e7cc3fce21ac6f
parent 7b4d31af2b7c66345df8c9147468076c6cb8ab8e
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:27 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:27 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 43 +++++++++++++++---------------- 1 files changed, 21 insertions(+), 22 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +21 -22
@@ -173,13 +173,12 @@ static int sctp_print_tuple(struct seq_file *s, }/* Print out the private part of the conntrack. */ -static int sctp_print_conntrack (struct seq_file *s, -const struct nf_conn *conntrack) +static int sctp_print_conntrack (struct seq_file *s,const struct nf_conn *ct) {enum sctp_conntrack state;read_lock_bh (&sctp_lock); - state = conntrack->proto.sctp.state; + state = ct->proto.sctp.state;read_unlock_bh (&sctp_lock);return seq_printf (s,"%s " , sctp_conntrack_names[state]);
@@ -192,7 +191,7 @@ for ((offset) = (dataoff) + sizeof(sctp_sctphdr_t), (count) = 0; \ (offset) += (ntohs((sch)->length) + 3) & ~3, (count)++)/* Some validity checks to make sure the chunks are fine */ -static int do_basic_checks (struct nf_conn *conntrack, +static int do_basic_checks (struct nf_conn *ct,const struct sk_buff *skb,unsigned int dataoff,unsigned long *map)
@@ -293,7 +292,7 @@ static int new_state(enum ip_conntrack_dir dir, }/* Returns verdict for packet, or -1 for invalid. */ -static int sctp_packet(struct nf_conn *conntrack, +static int sctp_packet(struct nf_conn *ct, const struct sk_buff *skb, unsigned int dataoff, enum ip_conntrack_info ctinfo,
@@ -310,7 +309,7 @@ static int sctp_packet(struct nf_conn *conntrack,if (sh ==NULL )return -1 ; -if (do_basic_checks (conntrack, skb, dataoff, map) !=0 ) +if (do_basic_checks (ct, skb, dataoff, map) !=0 )return -1 ;/* Check the verification tag (Sec 8.5) */
@@ -319,7 +318,7 @@ static int sctp_packet(struct nf_conn *conntrack, !test_bit(SCTP_CID_COOKIE_ECHO, map) && !test_bit(SCTP_CID_ABORT, map) && !test_bit(SCTP_CID_SHUTDOWN_ACK, map) && - sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR(ctinfo)]) { + sh->vtag != ct->proto.sctp.vtag[CTINFO2DIR(ctinfo)]) {pr_debug ("Verification tag check failed\n" );return -1 ; }
@@ -337,28 +336,28 @@ static int sctp_packet(struct nf_conn *conntrack, } }else if (sch->type ==SCTP_CID_ABORT ) {/* Sec 8.5.1 (B) */ -if (sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)] && - sh->vtag != conntrack->proto.sctp.vtag[1 -CTINFO2DIR (ctinfo)]) { +if (sh->vtag != ct->proto.sctp.vtag[CTINFO2DIR (ctinfo)] && + sh->vtag != ct->proto.sctp.vtag[1 -CTINFO2DIR (ctinfo)]) {write_unlock_bh (&sctp_lock);return -1 ; } }else if (sch->type ==SCTP_CID_SHUTDOWN_COMPLETE ) {/* Sec 8.5.1 (C) */ -if (sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)] && - sh->vtag != conntrack->proto.sctp.vtag[1 -CTINFO2DIR (ctinfo)] && +if (sh->vtag != ct->proto.sctp.vtag[CTINFO2DIR (ctinfo)] && + sh->vtag != ct->proto.sctp.vtag[1 -CTINFO2DIR (ctinfo)] && (sch->flags &1 )) {write_unlock_bh (&sctp_lock);return -1 ; } }else if (sch->type ==SCTP_CID_COOKIE_ECHO ) {/* Sec 8.5.1 (D) */ -if (sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR (ctinfo)]) { +if (sh->vtag != ct->proto.sctp.vtag[CTINFO2DIR (ctinfo)]) {write_unlock_bh (&sctp_lock);return -1 ; } } - oldsctpstate = conntrack->proto.sctp.state; + oldsctpstate = ct->proto.sctp.state; newconntrack =new_state (CTINFO2DIR (ctinfo), oldsctpstate, sch->type);/* Invalid */
@@ -383,22 +382,22 @@ static int sctp_packet(struct nf_conn *conntrack, }pr_debug ("Setting vtag %x for dir %d\n" , ih->init_tag, !CTINFO2DIR (ctinfo)); - conntrack->proto.sctp.vtag[!CTINFO2DIR (ctinfo)] = ih->init_tag; + ct->proto.sctp.vtag[!CTINFO2DIR (ctinfo)] = ih->init_tag; } - conntrack->proto.sctp.state = newconntrack; + ct->proto.sctp.state = newconntrack;if (oldsctpstate != newconntrack)nf_conntrack_event_cache (IPCT_PROTOINFO , skb);write_unlock_bh (&sctp_lock); } -nf_ct_refresh_acct (conntrack, ctinfo, skb, *sctp_timeouts[newconntrack]); +nf_ct_refresh_acct (ct, ctinfo, skb, *sctp_timeouts[newconntrack]);if (oldsctpstate ==SCTP_CONNTRACK_COOKIE_ECHOED &&CTINFO2DIR (ctinfo) ==IP_CT_DIR_REPLY && newconntrack ==SCTP_CONNTRACK_ESTABLISHED ) {pr_debug ("Setting assured bit\n" ); -set_bit (IPS_ASSURED_BIT , &conntrack->status); +set_bit (IPS_ASSURED_BIT , &ct->status);nf_conntrack_event_cache (IPCT_STATUS , skb); }
@@ -406,7 +405,7 @@ static int sctp_packet(struct nf_conn *conntrack, }/* Called when a new connection for this protocol found. */ -static int sctp_new (struct nf_conn *conntrack,const struct sk_buff *skb, +static int sctp_new (struct nf_conn *ct,const struct sk_buff *skb,unsigned int dataoff) {enum sctp_conntrack newconntrack;
@@ -419,7 +418,7 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,if (sh ==NULL )return 0 ; -if (do_basic_checks (conntrack, skb, dataoff, map) !=0 ) +if (do_basic_checks (ct, skb, dataoff, map) !=0 )return 0 ;/* If an OOTB packet has any of these chunks discard (Sec 8.4) */
@@ -454,7 +453,7 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,pr_debug ("Setting vtag %x for new conn\n" , ih->init_tag); - conntrack->proto.sctp.vtag[IP_CT_DIR_REPLY ] = + ct->proto.sctp.vtag[IP_CT_DIR_REPLY ] = ih->init_tag; }else {/* Sec 8.5.1 (A) */
@@ -466,10 +465,10 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,else {pr_debug ("Setting vtag %x for new conn OOTB\n" , sh->vtag); - conntrack->proto.sctp.vtag[IP_CT_DIR_REPLY ] = sh->vtag; + ct->proto.sctp.vtag[IP_CT_DIR_REPLY ] = sh->vtag; } - conntrack->proto.sctp.state = newconntrack; + ct->proto.sctp.state = newconntrack; }return 1 ;
PATCH 28/38 : nf_conntrack_sctp: reduce line length further
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_sctp: reduce line length further
Eliminate a few lines over 80 characters by using a local variable to hold the conntrack direction instead of using CTINFO2DIR everywhere.
---
commit 813e62c43db7ec9a71df93147f422c0aa9b8fe67
tree 18269f6b89a5fc02b9418a56410c21a36924edb9
parent 1880ca6a51b7d8404a574db37e9fe1ad4349a580
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:27 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:27 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +12 -11
@@ -300,6 +300,7 @@ static int sctp_packet(struct nf_conn *ct, unsigned int hooknum) {enum sctp_conntrack newconntrack, oldsctpstate; +enum ip_conntrack_dir dir =CTINFO2DIR (ctinfo);sctp_sctphdr_t _sctph, *sh;sctp_chunkhdr_t _sch, *sch;u_int32_t offset, count;
@@ -318,7 +319,7 @@ static int sctp_packet(struct nf_conn *ct, !test_bit(SCTP_CID_COOKIE_ECHO, map) && !test_bit(SCTP_CID_ABORT, map) && !test_bit(SCTP_CID_SHUTDOWN_ACK, map) && - sh->vtag != ct->proto.sctp.vtag[CTINFO2DIR(ctinfo)]) { + sh->vtag != ct->proto.sctp.vtag[dir]) {pr_debug ("Verification tag check failed\n" );return -1 ; }
@@ -336,35 +337,35 @@ static int sctp_packet(struct nf_conn *ct, } }else if (sch->type ==SCTP_CID_ABORT ) {/* Sec 8.5.1 (B) */ -if (sh->vtag != ct->proto.sctp.vtag[CTINFO2DIR (ctinfo)] && - sh->vtag != ct->proto.sctp.vtag[1 -CTINFO2DIR (ctinfo)]) { +if (sh->vtag != ct->proto.sctp.vtag[dir] && + sh->vtag != ct->proto.sctp.vtag[!dir]) {write_unlock_bh (&sctp_lock);return -1 ; } }else if (sch->type ==SCTP_CID_SHUTDOWN_COMPLETE ) {/* Sec 8.5.1 (C) */ -if (sh->vtag != ct->proto.sctp.vtag[CTINFO2DIR (ctinfo)] && - sh->vtag != ct->proto.sctp.vtag[1 -CTINFO2DIR (ctinfo)] && +if (sh->vtag != ct->proto.sctp.vtag[dir] && + sh->vtag != ct->proto.sctp.vtag[!dir] && (sch->flags &1 )) {write_unlock_bh (&sctp_lock);return -1 ; } }else if (sch->type ==SCTP_CID_COOKIE_ECHO ) {/* Sec 8.5.1 (D) */ -if (sh->vtag != ct->proto.sctp.vtag[CTINFO2DIR (ctinfo)]) { +if (sh->vtag != ct->proto.sctp.vtag[dir]) {write_unlock_bh (&sctp_lock);return -1 ; } } oldsctpstate = ct->proto.sctp.state; - newconntrack =new_state (CTINFO2DIR (ctinfo), oldsctpstate, sch->type); + newconntrack =new_state (dir, oldsctpstate, sch->type);/* Invalid */ if (newconntrack ==SCTP_CONNTRACK_MAX ) {pr_debug ("nf_conntrack_sctp: Invalid dir=%i ctype=%u " "conntrack=%u\n" , -CTINFO2DIR (ctinfo), sch->type, oldsctpstate); + dir, sch->type, oldsctpstate);write_unlock_bh (&sctp_lock);return -1 ; }
@@ -381,8 +382,8 @@ static int sctp_packet(struct nf_conn *ct,return -1 ; }pr_debug ("Setting vtag %x for dir %d\n" , - ih->init_tag, !CTINFO2DIR (ctinfo)); - ct->proto.sctp.vtag[!CTINFO2DIR (ctinfo)] = ih->init_tag; + ih->init_tag, !dir); + ct->proto.sctp.vtag[!dir] = ih->init_tag; } ct->proto.sctp.state = newconntrack;
@@ -394,7 +395,7 @@ static int sctp_packet(struct nf_conn *ct,nf_ct_refresh_acct (ct, ctinfo, skb, *sctp_timeouts[newconntrack]);if (oldsctpstate ==SCTP_CONNTRACK_COOKIE_ECHOED && -CTINFO2DIR (ctinfo) ==IP_CT_DIR_REPLY && + dir ==IP_CT_DIR_REPLY && newconntrack ==SCTP_CONNTRACK_ESTABLISHED ) {pr_debug ("Setting assured bit\n" );set_bit (IPS_ASSURED_BIT , &ct->status);
PATCH 29/38 : nf_conntrack_sctp: consolidate sctp_packet() error paths
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_sctp: consolidate sctp_packet() error paths
Consolidate error paths and use proper symbolic return value instead of magic values.
---
commit 55c98e3af141112533dfc4365b9b03997893a33f
tree d1ca354781c0848cef5964e1bf0e69fe8ceab627
parent 813e62c43db7ec9a71df93147f422c0aa9b8fe67
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:27 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:27 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 46 +++++++++++++------------------ 1 files changed, 20 insertions(+), 26 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +20 -26
@@ -291,7 +291,7 @@ static int new_state(enum ip_conntrack_dir dir,return sctp_conntracks[dir][i][cur_state]; } -/* Returns verdict for packet, or -1 for invalid. */ +/* Returns verdict for packet, or -NF_ACCEPT for invalid. */ static int sctp_packet(struct nf_conn *ct, const struct sk_buff *skb, unsigned int dataoff,
@@ -308,10 +308,10 @@ static int sctp_packet(struct nf_conn *ct, sh =skb_header_pointer (skb, dataoff,sizeof (_sctph), &_sctph);if (sh ==NULL ) -return -1 ; + goto out;if (do_basic_checks (ct, skb, dataoff, map) !=0 ) -return -1 ; + goto out;/* Check the verification tag (Sec 8.5) */ if (!test_bit(SCTP_CID_INIT, map) &&
@@ -321,7 +321,7 @@ static int sctp_packet(struct nf_conn *ct, !test_bit(SCTP_CID_SHUTDOWN_ACK, map) && sh->vtag != ct->proto.sctp.vtag[dir]) {pr_debug ("Verification tag check failed\n" ); -return -1 ; + goto out; } oldsctpstate = newconntrack =SCTP_CONNTRACK_MAX ;
@@ -331,31 +331,23 @@ static int sctp_packet(struct nf_conn *ct,/* Special cases of Verification tag check (Sec 8.5.1) */ if (sch->type ==SCTP_CID_INIT ) {/* Sec 8.5.1 (A) */ -if (sh->vtag !=0 ) { -write_unlock_bh (&sctp_lock); -return -1 ; - } +if (sh->vtag !=0 ) + goto out_unlock; }else if (sch->type ==SCTP_CID_ABORT ) {/* Sec 8.5.1 (B) */ if (sh->vtag != ct->proto.sctp.vtag[dir] && - sh->vtag != ct->proto.sctp.vtag[!dir]) { -write_unlock_bh (&sctp_lock); -return -1 ; - } + sh->vtag != ct->proto.sctp.vtag[!dir]) + goto out_unlock; }else if (sch->type ==SCTP_CID_SHUTDOWN_COMPLETE ) {/* Sec 8.5.1 (C) */ if (sh->vtag != ct->proto.sctp.vtag[dir] && sh->vtag != ct->proto.sctp.vtag[!dir] && - (sch->flags &1 )) { -write_unlock_bh (&sctp_lock); -return -1 ; - } + (sch->flags &1 )) + goto out_unlock; }else if (sch->type ==SCTP_CID_COOKIE_ECHO ) {/* Sec 8.5.1 (D) */ -if (sh->vtag != ct->proto.sctp.vtag[dir]) { -write_unlock_bh (&sctp_lock); -return -1 ; - } +if (sh->vtag != ct->proto.sctp.vtag[dir]) + goto out_unlock; } oldsctpstate = ct->proto.sctp.state;
@@ -366,8 +358,7 @@ static int sctp_packet(struct nf_conn *ct,pr_debug ("nf_conntrack_sctp: Invalid dir=%i ctype=%u " "conntrack=%u\n" , dir, sch->type, oldsctpstate); -write_unlock_bh (&sctp_lock); -return -1 ; + goto out_unlock; }/* If it is an INIT or an INIT ACK note down the vtag */
@@ -377,10 +368,8 @@ static int sctp_packet(struct nf_conn *ct, ih =skb_header_pointer (skb, offset +sizeof (sctp_chunkhdr_t),sizeof (_inithdr), &_inithdr); -if (ih ==NULL ) { -write_unlock_bh (&sctp_lock); -return -1 ; - } +if (ih ==NULL ) + goto out_unlock;pr_debug ("Setting vtag %x for dir %d\n" , ih->init_tag, !dir); ct->proto.sctp.vtag[!dir] = ih->init_tag;
@@ -403,6 +392,11 @@ static int sctp_packet(struct nf_conn *ct, }return NF_ACCEPT ; + +out_unlock: +write_unlock_bh (&sctp_lock); +out: +return -NF_ACCEPT ; }/* Called when a new connection for this protocol found. */
PATCH 30/38 : nf_conntrack_sctp: rename "newconntrack" variable
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_sctp: rename "newconntrack" variable
The name is misleading, it holds the new connection state, so rename it to "newstate". Also rename "oldsctpstate" to "oldstate" for consistency.
---
commit 426d981e95c0171858e0e4658373986717739fa5
tree 2b13b2c192919d8c5f155d1d4ba18cdb0069082b
parent 55c98e3af141112533dfc4365b9b03997893a33f
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:28 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:28 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 42 ++++++++++++++++--------------- 1 files changed, 21 insertions(+), 21 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +21 -21
@@ -231,9 +231,9 @@ static int do_basic_checks(struct nf_conn *ct,return count ==0 ; } -static int new_state (enum ip_conntrack_dir dir, -enum sctp_conntrack cur_state, -int chunk_type) +static int sctp_new_state (enum ip_conntrack_dir dir, +enum sctp_conntrack cur_state, +int chunk_type) {int i;
@@ -299,7 +299,7 @@ static int sctp_packet(struct nf_conn *ct, int pf, unsigned int hooknum) { -enum sctp_conntrack newconntrack, oldsctpstate; +enum sctp_conntrack new_state, old_state;enum ip_conntrack_dir dir =CTINFO2DIR (ctinfo);sctp_sctphdr_t _sctph, *sh;sctp_chunkhdr_t _sch, *sch;
@@ -324,7 +324,7 @@ static int sctp_packet(struct nf_conn *ct, goto out; } - oldsctpstate = newconntrack =SCTP_CONNTRACK_MAX ; + old_state = new_state =SCTP_CONNTRACK_MAX ; for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) {write_lock_bh (&sctp_lock);
@@ -350,14 +350,14 @@ static int sctp_packet(struct nf_conn *ct, goto out_unlock; } - oldsctpstate = ct->proto.sctp.state; - newconntrack =new_state (dir, oldsctpstate, sch->type); + old_state = ct->proto.sctp.state; + new_state =sctp_new_state (dir, old_state, sch->type);/* Invalid */ -if (newconntrack ==SCTP_CONNTRACK_MAX ) { +if (new_state ==SCTP_CONNTRACK_MAX ) {pr_debug ("nf_conntrack_sctp: Invalid dir=%i ctype=%u " "conntrack=%u\n" , - dir, sch->type, oldsctpstate); + dir, sch->type, old_state); goto out_unlock; }
@@ -375,17 +375,17 @@ static int sctp_packet(struct nf_conn *ct, ct->proto.sctp.vtag[!dir] = ih->init_tag; } - ct->proto.sctp.state = newconntrack; -if (oldsctpstate != newconntrack) + ct->proto.sctp.state = new_state; +if (old_state != new_state)nf_conntrack_event_cache (IPCT_PROTOINFO , skb);write_unlock_bh (&sctp_lock); } -nf_ct_refresh_acct (ct, ctinfo, skb, *sctp_timeouts[newconntrack]); +nf_ct_refresh_acct (ct, ctinfo, skb, *sctp_timeouts[new_state]); -if (oldsctpstate ==SCTP_CONNTRACK_COOKIE_ECHOED && +if (old_state ==SCTP_CONNTRACK_COOKIE_ECHOED && dir ==IP_CT_DIR_REPLY && - newconntrack ==SCTP_CONNTRACK_ESTABLISHED ) { + new_state ==SCTP_CONNTRACK_ESTABLISHED ) {pr_debug ("Setting assured bit\n" );set_bit (IPS_ASSURED_BIT , &ct->status);nf_conntrack_event_cache (IPCT_STATUS , skb);
@@ -403,7 +403,7 @@ out:static int sctp_new (struct nf_conn *ct,const struct sk_buff *skb,unsigned int dataoff) { -enum sctp_conntrack newconntrack; +enum sctp_conntrack new_state;sctp_sctphdr_t _sctph, *sh;sctp_chunkhdr_t _sch, *sch;u_int32_t offset, count;
@@ -422,15 +422,15 @@ static int sctp_new(struct nf_conn *ct, const struct sk_buff *skb, test_bit(SCTP_CID_COOKIE_ACK, map))return 0 ; - newconntrack =SCTP_CONNTRACK_MAX ; + new_state =SCTP_CONNTRACK_MAX ; for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) {/* Don't need lock here: this conntrack not in circulation yet */ - newconntrack =new_state (IP_CT_DIR_ORIGINAL , -SCTP_CONNTRACK_NONE , sch->type); + new_state =sctp_new_state (IP_CT_DIR_ORIGINAL , +SCTP_CONNTRACK_NONE , sch->type);/* Invalid: delete conntrack */ -if (newconntrack ==SCTP_CONNTRACK_NONE || - newconntrack ==SCTP_CONNTRACK_MAX ) { +if (new_state ==SCTP_CONNTRACK_NONE || + new_state ==SCTP_CONNTRACK_MAX ) {pr_debug ("nf_conntrack_sctp: invalid new deleting.\n" );return 0 ; }
@@ -463,7 +463,7 @@ static int sctp_new(struct nf_conn *ct, const struct sk_buff *skb, ct->proto.sctp.vtag[IP_CT_DIR_REPLY ] = sh->vtag; } - ct->proto.sctp.state = newconntrack; + ct->proto.sctp.state = new_state; }return 1 ;
PATCH 31/38 : nf_conntrack_sctp: don't take sctp_lock once per chunk
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_sctp: don't take sctp_lock once per chunk
Don't take and release the lock once per SCTP chunk, simply hold it the entire time while iterating through the chunks.
---
commit febaa2eab0d9efc458d9cbefef7fa7f9859250d1
tree b8062780663c6d45112f973ae2d8b51da74969b8
parent 426d981e95c0171858e0e4658373986717739fa5
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:28 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:28 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +2 -3
@@ -325,9 +325,8 @@ static int sctp_packet(struct nf_conn *ct, } old_state = new_state =SCTP_CONNTRACK_MAX ; +write_lock_bh (&sctp_lock); for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) { -write_lock_bh (&sctp_lock); -/* Special cases of Verification tag check (Sec 8.5.1) */ if (sch->type ==SCTP_CID_INIT ) {/* Sec 8.5.1 (A) */
@@ -378,8 +377,8 @@ static int sctp_packet(struct nf_conn *ct, ct->proto.sctp.state = new_state;if (old_state != new_state)nf_conntrack_event_cache (IPCT_PROTOINFO , skb); -write_unlock_bh (&sctp_lock); } +write_unlock_bh (&sctp_lock);nf_ct_refresh_acct (ct, ctinfo, skb, *sctp_timeouts[new_state]);
PATCH 32/38 : nf_conntrack_sctp: remove unused ttag field from conntrack data
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_sctp: remove unused ttag field from conntrack data
Spotted by Pablo Neira Ayuso <[email protected]>.
---
commit 5c06ef38713fa6bc6cb80f7834464e4761a383dc
tree 9e8564b679a5a4a95e0e98c02e0c2040a5f3248e
parent febaa2eab0d9efc458d9cbefef7fa7f9859250d1
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:29 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:29 +0100
include/linux/netfilter/nf_conntrack_sctp.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
include/linux/netfilter/nf_conntrack_sctp.h +0 -1
@@ -21,7 +21,6 @@ struct ip_ct_sctpenum sctp_conntrack state; __be32 vtag[IP_CT_DIR_MAX]; - u_int32_t ttag[IP_CT_DIR_MAX]; };#endif /* _NF_CONNTRACK_SCTP_H */
PATCH 33/38 : nf_conntrack_sctp: replace magic value by symbolic constant
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_sctp: replace magic value by symbolic constant
Use SCTP_CHUNK_FLAG_T instead of 0x1.
---
commit 07f97b30ff30a5ce17377199ae32176b5dab5b08
tree 72dc2a95665128b415c457c3db4ab18d56ce149c
parent 5c06ef38713fa6bc6cb80f7834464e4761a383dc
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:29 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:29 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +1 -1
@@ -341,7 +341,7 @@ static int sctp_packet(struct nf_conn *ct,/* Sec 8.5.1 (C) */ if (sh->vtag != ct->proto.sctp.vtag[dir] && sh->vtag != ct->proto.sctp.vtag[!dir] && - (sch->flags &1 )) + sch->flags &SCTP_CHUNK_FLAG_T ) goto out_unlock; }else if (sch->type ==SCTP_CID_COOKIE_ECHO ) {/* Sec 8.5.1 (D) */
PATCH 34/38 : nf_conntrack_sctp: remove timeout indirection
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_sctp: remove timeout indirection
Instead of keeping pointers to the timeout values in a table, simply put the timeout values in the table directly.
---
commit 918cc347b331a901245021bd85c1cb3c7ff54482
tree a7aa2f2d554107ce90f7c4e4da77711ce954e235
parent 07f97b30ff30a5ce17377199ae32176b5dab5b08
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:30 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:30 +0100
net/netfilter/nf_conntrack_proto_sctp.c | 57 +++++++++++++------------------ 1 files changed, 24 insertions(+), 33 deletions(-)
net/netfilter/nf_conntrack_proto_sctp.c +24 -33
@@ -49,24 +49,15 @@ static const char *sctp_conntrack_names[] = {#define HOURS * 60 MINS#define DAYS * 24 HOURS -static unsigned int nf_ct_sctp_timeout_closed __read_mostly = 10 SECS; -static unsigned int nf_ct_sctp_timeout_cookie_wait __read_mostly = 3 SECS; -static unsigned int nf_ct_sctp_timeout_cookie_echoed __read_mostly = 3 SECS; -static unsigned int nf_ct_sctp_timeout_established __read_mostly = 5 DAYS; -static unsigned int nf_ct_sctp_timeout_shutdown_sent __read_mostly = 300 SECS / 1000; -static unsigned int nf_ct_sctp_timeout_shutdown_recd __read_mostly = 300 SECS / 1000; -static unsigned int nf_ct_sctp_timeout_shutdown_ack_sent __read_mostly = 3 SECS; - -static unsigned int * sctp_timeouts[] -= {NULL ,/* SCTP_CONNTRACK_NONE */ - &nf_ct_sctp_timeout_closed,/* SCTP_CONNTRACK_CLOSED */ - &nf_ct_sctp_timeout_cookie_wait,/* SCTP_CONNTRACK_COOKIE_WAIT */ - &nf_ct_sctp_timeout_cookie_echoed,/* SCTP_CONNTRACK_COOKIE_ECHOED */ - &nf_ct_sctp_timeout_established,/* SCTP_CONNTRACK_ESTABLISHED */ - &nf_ct_sctp_timeout_shutdown_sent,/* SCTP_CONNTRACK_SHUTDOWN_SENT */ - &nf_ct_sctp_timeout_shutdown_recd,/* SCTP_CONNTRACK_SHUTDOWN_RECD */ - &nf_ct_sctp_timeout_shutdown_ack_sent/* SCTP_CONNTRACK_SHUTDOWN_ACK_SENT */ - }; +static unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX ]__read_mostly = { + [SCTP_CONNTRACK_CLOSED] = 10 SECS, + [SCTP_CONNTRACK_COOKIE_WAIT] = 3 SECS, + [SCTP_CONNTRACK_COOKIE_ECHOED] = 3 SECS, + [SCTP_CONNTRACK_ESTABLISHED] = 5 DAYS, + [SCTP_CONNTRACK_SHUTDOWN_SENT] = 300 SECS / 1000, + [SCTP_CONNTRACK_SHUTDOWN_RECD] = 300 SECS / 1000, + [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT] = 3 SECS, +};#define sNO SCTP_CONNTRACK_NONE#define sCL SCTP_CONNTRACK_CLOSED
@@ -380,7 +371,7 @@ static int sctp_packet(struct nf_conn *ct, }write_unlock_bh (&sctp_lock); -nf_ct_refresh_acct (ct, ctinfo, skb, *sctp_timeouts[new_state]); +nf_ct_refresh_acct (ct, ctinfo, skb, sctp_timeouts[new_state]); if (old_state == SCTP_CONNTRACK_COOKIE_ECHOED && dir == IP_CT_DIR_REPLY &&
@@ -474,49 +465,49 @@ static struct ctl_table_header *sctp_sysctl_header;static struct ctl_table sctp_sysctl_table[] = { { .procname ="nf_conntrack_sctp_timeout_closed" , - .data = &nf_ct_sctp_timeout_closed, + .data = &sctp_timeouts[SCTP_CONNTRACK_CLOSED ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_sctp_timeout_cookie_wait" , - .data = &nf_ct_sctp_timeout_cookie_wait, + .data = &sctp_timeouts[SCTP_CONNTRACK_COOKIE_WAIT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_sctp_timeout_cookie_echoed" , - .data = &nf_ct_sctp_timeout_cookie_echoed, + .data = &sctp_timeouts[SCTP_CONNTRACK_COOKIE_ECHOED ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_sctp_timeout_established" , - .data = &nf_ct_sctp_timeout_established, + .data = &sctp_timeouts[SCTP_CONNTRACK_ESTABLISHED ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_sctp_timeout_shutdown_sent" , - .data = &nf_ct_sctp_timeout_shutdown_sent, + .data = &sctp_timeouts[SCTP_CONNTRACK_SHUTDOWN_SENT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_sctp_timeout_shutdown_recd" , - .data = &nf_ct_sctp_timeout_shutdown_recd, + .data = &sctp_timeouts[SCTP_CONNTRACK_SHUTDOWN_RECD ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="nf_conntrack_sctp_timeout_shutdown_ack_sent" , - .data = &nf_ct_sctp_timeout_shutdown_ack_sent, + .data = &sctp_timeouts[SCTP_CONNTRACK_SHUTDOWN_ACK_SENT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies,
@@ -530,49 +521,49 @@ static struct ctl_table sctp_sysctl_table[] = {static struct ctl_table sctp_compat_sysctl_table[] = { { .procname ="ip_conntrack_sctp_timeout_closed" , - .data = &nf_ct_sctp_timeout_closed, + .data = &sctp_timeouts[SCTP_CONNTRACK_CLOSED ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_sctp_timeout_cookie_wait" , - .data = &nf_ct_sctp_timeout_cookie_wait, + .data = &sctp_timeouts[SCTP_CONNTRACK_COOKIE_WAIT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_sctp_timeout_cookie_echoed" , - .data = &nf_ct_sctp_timeout_cookie_echoed, + .data = &sctp_timeouts[SCTP_CONNTRACK_COOKIE_ECHOED ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_sctp_timeout_established" , - .data = &nf_ct_sctp_timeout_established, + .data = &sctp_timeouts[SCTP_CONNTRACK_ESTABLISHED ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_sctp_timeout_shutdown_sent" , - .data = &nf_ct_sctp_timeout_shutdown_sent, + .data = &sctp_timeouts[SCTP_CONNTRACK_SHUTDOWN_SENT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_sctp_timeout_shutdown_recd" , - .data = &nf_ct_sctp_timeout_shutdown_recd, + .data = &sctp_timeouts[SCTP_CONNTRACK_SHUTDOWN_RECD ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies, }, { .procname ="ip_conntrack_sctp_timeout_shutdown_ack_sent" , - .data = &nf_ct_sctp_timeout_shutdown_ack_sent, + .data = &sctp_timeouts[SCTP_CONNTRACK_SHUTDOWN_ACK_SENT ], .maxlen =sizeof (unsigned int ), .mode =0644 , .proc_handler = &proc_dointvec_jiffies,
PATCH 35/38 : kill nf_sysctl.c
In reply to Patrick McHardy[NETFILTER]: kill nf_sysctl.c
Since there now is generic support for shared sysctl paths, the only remains are the net/netfilter and net/ipv4/netfilter paths. Move them to net/netfilter/core.c and net/ipv4/netfilter.c and kill nf_sysctl.c.
---
commit b243ece57ad7c480af162ff7cc857b8aa2b0c409
tree 693c714dbe16fa64247a5bfa7d2ef6da944952bd
parent 918cc347b331a901245021bd85c1cb3c7ff54482
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:30 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:30 +0100
net/ipv4/netfilter.c | 10 ++++++++++ net/netfilter/Makefile | 1 - net/netfilter/core.c | 9 +++++++++ net/netfilter/nf_sysctl.c | 25 ------------------------- 4 files changed, 19 insertions(+), 26 deletions(-)
net/ipv4/netfilter.c +10 -0
@@ -211,3 +211,13 @@ static void ipv4_netfilter_fini(void)module_init (ipv4_netfilter_init);module_exit (ipv4_netfilter_fini); + +#ifdef CONFIG_SYSCTL +struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = { + { .procname ="net" , .ctl_name =CTL_NET , }, + { .procname ="ipv4" , .ctl_name =NET_IPV4 , }, + { .procname ="netfilter" , .ctl_name =NET_IPV4_NETFILTER , }, + { } +}; +EXPORT_SYMBOL_GPL (nf_net_ipv4_netfilter_sysctl_path); +#endif /* CONFIG_SYSCTL */
net/netfilter/Makefile +0 -1
@@ -4,7 +4,6 @@ nf_conntrack-y := nf_conntrack_core.o nf_conntrack_standalone.o nf_conntrack_exp nf_conntrack-$(CONFIG_NF_CONNTRACK_EVENTS) += nf_conntrack_ecache.o obj-$(CONFIG_NETFILTER) = netfilter.o -obj-$(CONFIG_SYSCTL) += nf_sysctl.o obj-$(CONFIG_NETFILTER_NETLINK) += nfnetlink.o obj-$(CONFIG_NETFILTER_NETLINK_QUEUE) += nfnetlink_queue.o
net/netfilter/core.c +9 -0
@@ -272,3 +272,12 @@ void __init netfilter_init(void)if (netfilter_log_init () <0 )panic ("cannot initialize nf_log" ); } + +#ifdef CONFIG_SYSCTL +struct ctl_path nf_net_netfilter_sysctl_path[] = { + { .procname ="net" , .ctl_name =CTL_NET , }, + { .procname ="netfilter" , .ctl_name =NET_NETFILTER , }, + { } +}; +EXPORT_SYMBOL_GPL (nf_net_netfilter_sysctl_path); +#endif /* CONFIG_SYSCTL */
net/netfilter/nf_sysctl.c deleted +0 -25
@@ -1,25 +0,0 @@ -/* nf_sysctl.c netfilter sysctl registration/unregistation -* -* Copyright (c) 2006 Patrick McHardy <[email protected]> -*/ -#include <linux/module.h> -#include <linux/sysctl.h> -#include <linux/string.h> -#include <linux/slab.h> - -/* net/netfilter */ -struct ctl_path nf_net_netfilter_sysctl_path[] = { - { .procname ="net" , .ctl_name =CTL_NET , }, - { .procname ="netfilter" , .ctl_name =NET_NETFILTER , }, - { } -}; -EXPORT_SYMBOL_GPL (nf_net_netfilter_sysctl_path); - -/* net/ipv4/netfilter */ -struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = { - { .procname ="net" , .ctl_name =CTL_NET , }, - { .procname ="ipv4" , .ctl_name =NET_IPV4 , }, - { .procname ="netfilter" , .ctl_name =NET_IPV4_NETFILTER , }, - { } -}; -EXPORT_SYMBOL_GPL (nf_net_ipv4_netfilter_sysctl_path);
PATCH 36/38 : nf_conntrack: clean up a few header files
In reply to Patrick McHardy[NETFILTER]: nf_conntrack: clean up a few header files
- Remove declarations of non-existing variables and functions
- Move helper init/cleanup function declarations to nf_conntrack_helper.h
- Remove unneeded __nf_conntrack_attach declaration and make it static
---
commit acb619184a16c40b0f24fa7a66464a7494421b1f
tree 5f4365cd37acae2d1ebc55f3a79bf6368612a827
parent b243ece57ad7c480af162ff7cc857b8aa2b0c409
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:30 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:30 +0100
include/net/netfilter/nf_conntrack.h | 7 ------- include/net/netfilter/nf_conntrack_core.h | 12 ------------ include/net/netfilter/nf_conntrack_helper.h | 4 ++++ net/netfilter/nf_conntrack_core.c | 5 ++--- 4 files changed, 6 insertions(+), 22 deletions(-)
include/net/netfilter/nf_conntrack.h +0 -7
@@ -223,8 +223,6 @@ extern void nf_conntrack_tcp_update(struct sk_buff *skb,/* Fake conntrack entry for untracked connections */ extern struct nf_conn nf_conntrack_untracked; -extern int nf_ct_no_defrag; -/* Iterate over all conntracks: if iter returns true, it's deleted. */ extern void nf_ct_iterate_cleanup (int (*iter)(struct nf_conn *i,void *data),void *data);
@@ -264,10 +262,5 @@ do { \local_bh_enable (); \ } while (0) -extern int -nf_conntrack_register_cache (u_int32_t features,const char *name,size_t size); -extern void -nf_conntrack_unregister_cache (u_int32_t features); -#endif /* __KERNEL__ */ #endif /* _NF_CONNTRACK_H */
include/net/netfilter/nf_conntrack_core.h +0 -12
@@ -30,16 +30,6 @@ extern void nf_conntrack_cleanup(void);extern int nf_conntrack_proto_init (void );extern void nf_conntrack_proto_fini (void ); -extern int nf_conntrack_helper_init (void ); -extern void nf_conntrack_helper_fini (void ); - -struct nf_conntrack_l3proto ; -extern struct nf_conntrack_l3proto *nf_ct_find_l3proto (u_int16_t pf); -/* Like above, but you already have conntrack read lock. */ -extern struct nf_conntrack_l3proto *__nf_ct_find_l3proto (u_int16_t l3proto); - -struct nf_conntrack_l4proto ; - extern int nf_ct_get_tuple(const struct sk_buff *skb, unsigned int nhoff,
@@ -76,8 +66,6 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)return ret; } -extern void __nf_conntrack_attach (struct sk_buff *nskb,struct sk_buff *skb); - int print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple, struct nf_conntrack_l3proto *l3proto,
include/net/netfilter/nf_conntrack_helper.h +4 -0
@@ -58,4 +58,8 @@ static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) {return nf_ct_ext_find (ct,NF_CT_EXT_HELPER ); } + +extern int nf_conntrack_helper_init (void ); +extern void nf_conntrack_helper_fini (void ); +#endif /*_NF_CONNTRACK_HELPER_H*/
net/netfilter/nf_conntrack_core.c +2 -3
@@ -861,7 +861,7 @@ EXPORT_SYMBOL_GPL(nf_ct_port_nlattr_to_tuple);#endif /* Used by ipt_REJECT and ip6t_REJECT. */ -void __nf_conntrack_attach (struct sk_buff *nskb,struct sk_buff *skb) +static void nf_conntrack_attach (struct sk_buff *nskb,struct sk_buff *skb) {struct nf_conn *ct;enum ip_conntrack_info ctinfo;
@@ -878,7 +878,6 @@ void __nf_conntrack_attach(struct sk_buff *nskb, struct sk_buff *skb) nskb->nfctinfo = ctinfo;nf_conntrack_get (nskb->nfct); } -EXPORT_SYMBOL_GPL (__nf_conntrack_attach); static inline int do_iter(const struct nf_conntrack_tuple_hash *i,
@@ -1122,7 +1121,7 @@ int __init nf_conntrack_init(void) goto out_fini_expect;/* For use by REJECT target */ -rcu_assign_pointer (ip_ct_attach, __nf_conntrack_attach); +rcu_assign_pointer (ip_ct_attach, nf_conntrack_attach);rcu_assign_pointer (nf_ct_destroy, destroy_conntrack);/* Set up fake conntrack:
PATCH 37/38 : nf_conntrack: remove print_conntrack function from l3protos
In reply to Patrick McHardy[NETFILTER]: nf_conntrack: remove print_conntrack function from l3protos
Its unused and unlikely to ever be used.
---
commit 254624c5e171625a66d68b7ff457940b131de765
tree e17da32e0596fe4a1fb9bb46deaedd9158b7c469
parent acb619184a16c40b0f24fa7a66464a7494421b1f
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:31 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:31 +0100
include/net/netfilter/nf_conntrack_l3proto.h | 3 --- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 7 ------- .../netfilter/nf_conntrack_l3proto_ipv4_compat.c | 3 --- net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | 7 ------- net/netfilter/nf_conntrack_l3proto_generic.c | 7 ------- net/netfilter/nf_conntrack_standalone.c | 3 --- 6 files changed, 0 insertions(+), 30 deletions(-)
include/net/netfilter/nf_conntrack_l3proto.h +0 -3
@@ -42,9 +42,6 @@ struct nf_conntrack_l3protoint (*print_tuple)(struct seq_file *s,const struct nf_conntrack_tuple *); -/* Print out the private part of the conntrack. */ -int (*print_conntrack)(struct seq_file *s,const struct nf_conn *); -/* Returns verdict for packet, or -1 for invalid. */ int (*packet)(struct nf_conn *conntrack, const struct sk_buff *skb,
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +0 -7
@@ -56,12 +56,6 @@ static int ipv4_print_tuple(struct seq_file *s, NIPQUAD(tuple->dst.u3.ip)); } -static int ipv4_print_conntrack (struct seq_file *s, -const struct nf_conn *conntrack) -{ -return 0 ; -} -/* Returns new sk_buff, or NULL */ static int nf_ct_ipv4_gather_frags (struct sk_buff *skb,u_int32_t user) {
@@ -403,7 +397,6 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = { .pkt_to_tuple = ipv4_pkt_to_tuple, .invert_tuple = ipv4_invert_tuple, .print_tuple = ipv4_print_tuple, - .print_conntrack = ipv4_print_conntrack, .get_l4proto = ipv4_get_l4proto,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = ipv4_tuple_to_nlattr,
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +0 -3
@@ -121,9 +121,6 @@ static int ct_seq_show(struct seq_file *s, void *v) ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0)return -ENOSPC ; -if (l3proto->print_conntrack (s, ct)) -return -ENOSPC ; -if (l4proto->print_conntrack (s, ct))return -ENOSPC ;
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +0 -7
@@ -60,12 +60,6 @@ static int ipv6_print_tuple(struct seq_file *s, NIP6(*((struct in6_addr *)tuple->dst.u3.ip6))); } -static int ipv6_print_conntrack (struct seq_file *s, -const struct nf_conn *conntrack) -{ -return 0 ; -} -/* * Based on ipv6_skip_exthdr() in net/ipv6/exthdr.c *
@@ -376,7 +370,6 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6 __read_mostly = { .pkt_to_tuple = ipv6_pkt_to_tuple, .invert_tuple = ipv6_invert_tuple, .print_tuple = ipv6_print_tuple, - .print_conntrack = ipv6_print_conntrack, .get_l4proto = ipv6_get_l4proto,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = ipv6_tuple_to_nlattr,
net/netfilter/nf_conntrack_l3proto_generic.c +0 -7
@@ -55,12 +55,6 @@ static int generic_print_tuple(struct seq_file *s,return 0 ; } -static int generic_print_conntrack (struct seq_file *s, -const struct nf_conn *conntrack) -{ -return 0 ; -} -static int generic_get_l4proto (const struct sk_buff *skb,unsigned int nhoff,unsigned int *dataoff,u_int8_t *protonum) {
@@ -75,7 +69,6 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_generic __read_mostly = { .pkt_to_tuple = generic_pkt_to_tuple, .invert_tuple = generic_invert_tuple, .print_tuple = generic_print_tuple, - .print_conntrack = generic_print_conntrack, .get_l4proto = generic_get_l4proto, };EXPORT_SYMBOL_GPL (nf_conntrack_l3proto_generic);
net/netfilter/nf_conntrack_standalone.c +0 -3
@@ -142,9 +142,6 @@ static int ct_seq_show(struct seq_file *s, void *v) ? (long)(conntrack->timeout.expires - jiffies)/HZ : 0) != 0)return -ENOSPC ; -if (l3proto->print_conntrack (s, conntrack)) -return -ENOSPC ; -if (l4proto->print_conntrack (s, conntrack))return -ENOSPC ;
PATCH 38/38 : nf_conntrack: make print_conntrack function optional for l4protos
In reply to Patrick McHardy[NETFILTER]: nf_conntrack: make print_conntrack function optional for l4protos
Allows to remove five empty implementations.
---
commit 1b92cbe78d5e84fcc50ab1f890f23628dbd36f69
tree c336f72850df23d7eaa8be943697aebb3a23f56f
parent 254624c5e171625a66d68b7ff457940b131de765
author Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:31 +0100 committer Patrick McHardy <[email protected]> Tue, 15 Jan 2008 06:53:31 +0100
.../netfilter/nf_conntrack_l3proto_ipv4_compat.c | 2 +- net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 8 -------- net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 8 -------- net/netfilter/nf_conntrack_proto_generic.c | 8 -------- net/netfilter/nf_conntrack_proto_udp.c | 9 --------- net/netfilter/nf_conntrack_proto_udplite.c | 9 --------- net/netfilter/nf_conntrack_standalone.c | 2 +- 7 files changed, 2 insertions(+), 44 deletions(-)
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +1 -1
@@ -121,7 +121,7 @@ static int ct_seq_show(struct seq_file *s, void *v) ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0)return -ENOSPC ; -if (l4proto->print_conntrack (s, ct)) +if (l4proto->print_conntrack && l4proto->print_conntrack (s, ct))return -ENOSPC ; if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
net/ipv4/netfilter/nf_conntrack_proto_icmp.c +0 -8
@@ -74,13 +74,6 @@ static int icmp_print_tuple(struct seq_file *s, ntohs(tuple->src.u.icmp.id)); } -/* Print out the private part of the conntrack. */ -static int icmp_print_conntrack (struct seq_file *s, -const struct nf_conn *conntrack) -{ -return 0 ; -} -/* Returns verdict for packet, or -1 for invalid. */ static int icmp_packet(struct nf_conn *ct, const struct sk_buff *skb,
@@ -309,7 +302,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp __read_mostly = .pkt_to_tuple = icmp_pkt_to_tuple, .invert_tuple = icmp_invert_tuple, .print_tuple = icmp_print_tuple, - .print_conntrack = icmp_print_conntrack, .packet = icmp_packet, .new = icmp_new, .error = icmp_error,
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +0 -8
@@ -75,13 +75,6 @@ static int icmpv6_print_tuple(struct seq_file *s, ntohs(tuple->src.u.icmp.id)); } -/* Print out the private part of the conntrack. */ -static int icmpv6_print_conntrack (struct seq_file *s, -const struct nf_conn *conntrack) -{ -return 0 ; -} -/* Returns verdict for packet, or -1 for invalid. */ static int icmpv6_packet(struct nf_conn *ct, const struct sk_buff *skb,
@@ -275,7 +268,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly = .pkt_to_tuple = icmpv6_pkt_to_tuple, .invert_tuple = icmpv6_invert_tuple, .print_tuple = icmpv6_print_tuple, - .print_conntrack = icmpv6_print_conntrack, .packet = icmpv6_packet, .new = icmpv6_new, .error = icmpv6_error,
net/netfilter/nf_conntrack_proto_generic.c +0 -8
@@ -40,13 +40,6 @@ static int generic_print_tuple(struct seq_file *s,return 0 ; } -/* Print out the private part of the conntrack. */ -static int generic_print_conntrack (struct seq_file *s, -const struct nf_conn *state) -{ -return 0 ; -} -/* Returns verdict for packet, or -1 for invalid. */ static int packet(struct nf_conn *conntrack, const struct sk_buff *skb,
@@ -104,7 +97,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_generic __read_mostly = .pkt_to_tuple = generic_pkt_to_tuple, .invert_tuple = generic_invert_tuple, .print_tuple = generic_print_tuple, - .print_conntrack = generic_print_conntrack, .packet = packet, .new = new,#ifdef CONFIG_SYSCTL
net/netfilter/nf_conntrack_proto_udp.c +0 -9
@@ -60,13 +60,6 @@ static int udp_print_tuple(struct seq_file *s, ntohs(tuple->dst.u.udp.port)); } -/* Print out the private part of the conntrack. */ -static int udp_print_conntrack (struct seq_file *s, -const struct nf_conn *conntrack) -{ -return 0 ; -} -/* Returns verdict for packet, and may modify conntracktype */ static int udp_packet(struct nf_conn *conntrack, const struct sk_buff *skb,
@@ -193,7 +186,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 __read_mostly = .pkt_to_tuple = udp_pkt_to_tuple, .invert_tuple = udp_invert_tuple, .print_tuple = udp_print_tuple, - .print_conntrack = udp_print_conntrack, .packet = udp_packet, .new = udp_new, .error = udp_error,
@@ -221,7 +213,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 __read_mostly = .pkt_to_tuple = udp_pkt_to_tuple, .invert_tuple = udp_invert_tuple, .print_tuple = udp_print_tuple, - .print_conntrack = udp_print_conntrack, .packet = udp_packet, .new = udp_new, .error = udp_error,
net/netfilter/nf_conntrack_proto_udplite.c +0 -9
@@ -59,13 +59,6 @@ static int udplite_print_tuple(struct seq_file *s, ntohs(tuple->dst.u.udp.port)); } -/* Print out the private part of the conntrack. */ -static int udplite_print_conntrack (struct seq_file *s, -const struct nf_conn *conntrack) -{ -return 0 ; -} -/* Returns verdict for packet, and may modify conntracktype */ static int udplite_packet(struct nf_conn *conntrack, const struct sk_buff *skb,
@@ -198,7 +191,6 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4 __read_mostly = .pkt_to_tuple = udplite_pkt_to_tuple, .invert_tuple = udplite_invert_tuple, .print_tuple = udplite_print_tuple, - .print_conntrack = udplite_print_conntrack, .packet = udplite_packet, .new = udplite_new, .error = udplite_error,
@@ -222,7 +214,6 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite6 __read_mostly = .pkt_to_tuple = udplite_pkt_to_tuple, .invert_tuple = udplite_invert_tuple, .print_tuple = udplite_print_tuple, - .print_conntrack = udplite_print_conntrack, .packet = udplite_packet, .new = udplite_new, .error = udplite_error,
net/netfilter/nf_conntrack_standalone.c +1 -1
@@ -142,7 +142,7 @@ static int ct_seq_show(struct seq_file *s, void *v) ? (long)(conntrack->timeout.expires - jiffies)/HZ : 0) != 0)return -ENOSPC ; -if (l4proto->print_conntrack (s, conntrack)) +if (l4proto->print_conntrack && l4proto->print_conntrack (s, conntrack))return -ENOSPC ; if (print_tuple(s, &conntrack->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
David Miller
maintainerFrom: Patrick McHardy <[email protected]>
Date: Tue, 15 Jan 2008 07:19:12 +0100 (MET)
Quoted 10 lines
following is another netfilter update. The diffstat contains mostly noise from a
MODULE_DESCRIPTIONupdate, the main changes are:- removal of EXPERIMENTAL dependencies for all but a few selected modules
- Updates from Jan for multiple matches and targets to use fixed types, scheduling of the old version for removal in 2009
- IPv6 support for a few more matches and targets
Quoted 8 lines
- SCTP conntrack cleanup
- REJECT target conversion to construct TCP RSTs from scratch to properly deal with IP options
- Minor cleanups and optimizations
Please apply, thanks.
All applied, thanks Patrick.