: Netfilter Update for 2.6.19
Subsystems (4)
cover : Netfilter Update for 2.6.19
Hi Dave,
following is my first batch of netfilter patches for 2.6.19. Mostly cleanups and code consolidation and a few ctnetlink updates - it looks a lot larger than it is :)
Please apply, thanks.
include/linux/netfilter/nf_conntrack_common.h | 4 include/linux/netfilter/nfnetlink.h | 4 include/linux/netfilter/nfnetlink_log.h | 6 include/linux/netfilter/nfnetlink_queue.h | 8 include/linux/netfilter/x_tables.h | 19 +- include/linux/netfilter/xt_DSCP.h | 20 ++ include/linux/netfilter/xt_dscp.h | 23 ++ include/linux/netfilter_arp/arp_tables.h | 3 include/linux/netfilter_ipv4/ip_tables.h | 3 include/linux/netfilter_ipv4/ipt_DSCP.h | 6 include/linux/netfilter_ipv4/ipt_dscp.h | 14 - include/linux/netfilter_ipv6/ip6_tables.h | 3 net/ipv4/netfilter/Kconfig | 22 -- net/ipv4/netfilter/Makefile | 2 net/ipv4/netfilter/arp_tables.c | 14 - net/ipv4/netfilter/arpt_mangle.c | 4 net/ipv4/netfilter/arptable_filter.c | 2 net/ipv4/netfilter/ip_conntrack_netlink.c | 13 - net/ipv4/netfilter/ip_nat_rule.c | 10 - net/ipv4/netfilter/ip_tables.c | 23 -- net/ipv4/netfilter/ipt_CLUSTERIP.c | 7 net/ipv4/netfilter/ipt_DSCP.c | 96 ----------- net/ipv4/netfilter/ipt_ECN.c | 26 +-- net/ipv4/netfilter/ipt_LOG.c | 4 net/ipv4/netfilter/ipt_MASQUERADE.c | 4 net/ipv4/netfilter/ipt_NETMAP.c | 4 net/ipv4/netfilter/ipt_REDIRECT.c | 4 net/ipv4/netfilter/ipt_REJECT.c | 4 net/ipv4/netfilter/ipt_SAME.c | 7 net/ipv4/netfilter/ipt_TCPMSS.c | 4 net/ipv4/netfilter/ipt_TOS.c | 26 +-- net/ipv4/netfilter/ipt_TTL.c | 12 - net/ipv4/netfilter/ipt_ULOG.c | 3 net/ipv4/netfilter/ipt_ah.c | 1 net/ipv4/netfilter/ipt_dscp.c | 54 ------ net/ipv4/netfilter/ipt_ecn.c | 3 net/ipv4/netfilter/ipt_hashlimit.c | 4 net/ipv4/netfilter/ipt_owner.c | 1 net/ipv4/netfilter/ipt_recent.c | 13 + net/ipv4/netfilter/iptable_filter.c | 4 net/ipv4/netfilter/iptable_mangle.c | 4 net/ipv4/netfilter/iptable_raw.c | 2 net/ipv6/netfilter/Makefile | 2 net/ipv6/netfilter/ip6_tables.c | 19 -- net/ipv6/netfilter/ip6t_HL.c | 3 net/ipv6/netfilter/ip6t_LOG.c | 4 net/ipv6/netfilter/ip6t_REJECT.c | 8 net/ipv6/netfilter/ip6t_ah.c | 1 net/ipv6/netfilter/ip6t_dst.c | 220 -------------------------- net/ipv6/netfilter/ip6t_frag.c | 1 net/ipv6/netfilter/ip6t_hbh.c | 49 ++--- net/ipv6/netfilter/ip6t_ipv6header.c | 1 net/ipv6/netfilter/ip6t_owner.c | 1 net/ipv6/netfilter/ip6t_rt.c | 1 net/ipv6/netfilter/ip6table_filter.c | 4 net/ipv6/netfilter/ip6table_mangle.c | 4 net/ipv6/netfilter/ip6table_raw.c | 2 net/netfilter/Kconfig | 23 ++ net/netfilter/Makefile | 2 net/netfilter/nf_conntrack_netlink.c | 13 - net/netfilter/nfnetlink_queue.c | 4 net/netfilter/x_tables.c | 60 +++++++ net/netfilter/xt_CLASSIFY.c | 63 +++---- net/netfilter/xt_CONNMARK.c | 128 +++++++-------- net/netfilter/xt_CONNSECMARK.c | 61 ++----- net/netfilter/xt_DSCP.c | 188 ++++++++++++++++++---- net/netfilter/xt_MARK.c | 92 ++++------ net/netfilter/xt_NFQUEUE.c | 71 +++----- net/netfilter/xt_NOTRACK.c | 50 ++--- net/netfilter/xt_SECMARK.c | 59 ++---- net/netfilter/xt_comment.c | 45 ++--- net/netfilter/xt_connbytes.c | 50 ++--- net/netfilter/xt_connmark.c | 56 ++---- net/netfilter/xt_conntrack.c | 8 net/netfilter/xt_dccp.c | 52 ++---- net/netfilter/xt_dscp.c | 161 +++++++++++++++---- net/netfilter/xt_esp.c | 52 ++---- net/netfilter/xt_helper.c | 55 ++---- net/netfilter/xt_length.c | 43 ++--- net/netfilter/xt_limit.c | 48 ++--- net/netfilter/xt_mac.c | 52 ++---- net/netfilter/xt_mark.c | 48 ++--- net/netfilter/xt_multiport.c | 115 ++++--------- net/netfilter/xt_physdev.c | 50 ++--- net/netfilter/xt_pkttype.c | 44 ++--- net/netfilter/xt_policy.c | 54 ++---- net/netfilter/xt_quota.c | 53 ++---- net/netfilter/xt_sctp.c | 52 ++---- net/netfilter/xt_state.c | 56 ++---- net/netfilter/xt_statistic.c | 55 ++---- net/netfilter/xt_string.c | 54 ++---- net/netfilter/xt_tcpmss.c | 97 ++++------- net/netfilter/xt_tcpudp.c | 109 ++++-------- net/sched/act_ipt.c | 7 94 files changed, 1292 insertions(+), 1748 deletions(-)
Daniel De Graaf:
[NETFILTER]: ipt_recent: add module parameter for changing ownership of /proc/net/ipt_recent/*
Pablo Neira Ayuso:
[NETFILTER]: conntrack: introduce connection mark event [NETFILTER]: ctnetlink: dump connection mark
[NETFILTER]: ctnetlink: check for listeners before sending expectation events [NETFILTER]: ctnetlink: remove impossible events tests for updates
Patrick McHardy:
[NETFILTER]: nfnetlink_queue: fix typo in error message [NETFILTER]: replace open coded checksum updates
[NETFILTER]: xt_CONNMARK: use tabs for indentation
[NETFILTER]: x_tables: add helpers for mass match/target registration [NETFILTER]: x_tables: make use of mass registation helpers [NETFILTER]: x_tables: remove unused argument to target functions [NETFILTER]: x_tables: remove unused size argument to check/destroy functions [NETFILTER]: nfnetlink: remove unnecessary packed attributes [NETFILTER]: x_tables: add data member to struct xt_match [NETFILTER]: ip6_tables: consolidate dst and hbh matches [NETFILTER]: xt_tcpmss: minor cleanups
Yasuyuki Kozakai:
[NETFILTER]: x_tables: replace IPv4 dscp match by address family independent version [NETFILTER]: x_tables: replace IPv4 DSCP target by address family independent version
PATCH 1/18 : x_tables: replace IPv4 dscp match by address family independent version
[NETFILTER]: x_tables: replace IPv4 dscp match by address family independent version
This replaces IPv4 dscp match by address family independent version. This also
- utilizes dsfield.h to get the DS field in IPv4/IPv6 header, and
- checks for the DSCP value from user space.
- fixes Kconfig help text.
---
commit 8419c86c6871f880cd17a6cc29146d3d2da0477a
tree 3a134391c4d162f7675f4374c144f7f5e0ab3725
parent 99c4451081b0ea2107ba4827f7d518e1c739cf1b
author Yasuyuki Kozakai <[email protected]> Fri, 11 Aug 2006 20:35:46 +0200 committer Patrick McHardy <[email protected]> Fri, 11 Aug 2006 20:35:46 +0200
include/linux/netfilter/xt_dscp.h | 23 ++++++ include/linux/netfilter_ipv4/ipt_dscp.h | 14 ++-- net/ipv4/netfilter/Kconfig | 11 --- net/ipv4/netfilter/Makefile | 1 net/ipv4/netfilter/ipt_dscp.c | 54 --------------- net/netfilter/Kconfig | 11 +++ net/netfilter/Makefile | 1 net/netfilter/xt_dscp.c | 113 +++++++++++++++++++++++++++++++ 8 files changed, 154 insertions(+), 74 deletions(-)
include/linux/netfilter/xt_dscp.h new file +23 -0
@@ -0,0 +1,23 @@ +/* x_tables module for matching the IPv4/IPv6 DSCP field +* +* (C) 2002 Harald Welte <[email protected]> +* This software is distributed under GNU GPL v2, 1991 +* +* See RFC2474 for a description of the DSCP field within the IP Header. +* +* xt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp +*/ +#ifndef _XT_DSCP_H +#define _XT_DSCP_H + +#define XT_DSCP_MASK 0xfc/* 11111100 */ +#define XT_DSCP_SHIFT 2 +#define XT_DSCP_MAX 0x3f/* 00111111 */ + +/* match info */ +struct xt_dscp_info { +u_int8_t dscp; +u_int8_t invert; +}; + +#endif /* _XT_DSCP_H */
include/linux/netfilter_ipv4/ipt_dscp.h +6 -8
@@ -10,14 +10,12 @@#ifndef _IPT_DSCP_H#define _IPT_DSCP_H -#define IPT_DSCP_MASK 0xfc/* 11111100 */ -#define IPT_DSCP_SHIFT 2 -#define IPT_DSCP_MAX 0x3f/* 00111111 */ +#include <linux/netfilter/xt_dscp.h> -/* match info */ -struct ipt_dscp_info { -u_int8_t dscp; -u_int8_t invert; -}; +#define IPT_DSCP_MASK XT_DSCP_MASK +#define IPT_DSCP_SHIFT XT_DSCP_SHIFT +#define IPT_DSCP_MAX XT_DSCP_MAX + +#define ipt_dscp_info xt_dscp_info#endif /* _IPT_DSCP_H */
net/ipv4/netfilter/Kconfig +0 -11
@@ -278,17 +278,6 @@ config IP_NF_MATCH_ECN To compile it as a module, choose M here. If unsure, say N. -config IP_NF_MATCH_DSCP - tristate "DSCP match support" - depends on IP_NF_IPTABLES - help - This option adds a `DSCP' match, which allows you to match against - the IPv4 header DSCP field (DSCP codepoint). - - The DSCP codepoint can have any value between 0x0 and 0x4f. - - To compile it as a module, choose M here. If unsure, say N. - config IP_NF_MATCH_AH tristate "AH match support" depends on IP_NF_IPTABLES
net/ipv4/netfilter/Makefile +0 -1
@@ -59,7 +59,6 @@ obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_o obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o obj-$(CONFIG_IP_NF_MATCH_RECENT) += ipt_recent.o obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o -obj-$(CONFIG_IP_NF_MATCH_DSCP) += ipt_dscp.o obj-$(CONFIG_IP_NF_MATCH_AH) += ipt_ah.o obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o
net/ipv4/netfilter/ipt_dscp.c deleted +0 -54
54 lines not on this page · raw message
net/netfilter/Kconfig +11 -0
@@ -263,6 +263,17 @@ config NETFILTER_XT_MATCH_DCCP If you want to compile it as a module, say M here and read <file:Documentation/modules.txt>. If unsure, say `N'. +config NETFILTER_XT_MATCH_DSCP + tristate '"DSCP" match support' + depends on NETFILTER_XTABLES + help + This option adds a `DSCP' match, which allows you to match against + the IPv4/IPv6 header DSCP field (differentiated services codepoint). + + The DSCP field can have any value between 0x0 and 0x3f inclusive. + + To compile it as a module, choose M here. If unsure, say N. + config NETFILTER_XT_MATCH_ESP tristate '"ESP" match support' depends on NETFILTER_XTABLES
net/netfilter/Makefile +1 -0
@@ -37,6 +37,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_CONNBYTE obj-$(CONFIG_NETFILTER_XT_MATCH_CONNMARK) += xt_connmark.o obj-$(CONFIG_NETFILTER_XT_MATCH_CONNTRACK) += xt_conntrack.o obj-$(CONFIG_NETFILTER_XT_MATCH_DCCP) += xt_dccp.o +obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o obj-$(CONFIG_NETFILTER_XT_MATCH_ESP) += xt_esp.o obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.o obj-$(CONFIG_NETFILTER_XT_MATCH_LENGTH) += xt_length.o
net/netfilter/xt_dscp.c new file +113 -0
113 lines not on this page · raw message
PATCH 2/18 : x_tables: replace IPv4 DSCP target by address family independent version
In reply to Patrick McHardy[NETFILTER]: x_tables: replace IPv4 DSCP target by address family independent version
This replaces IPv4 DSCP target by address family independent version. This also
- utilizes dsfield.h to get/mangle DS field in IPv4/IPv6 header
- fixes Kconfig help text.
---
commit aee6e3b681f66196cf3ec43b53b252b61f870f1a
tree 4c4d9bc72012d42bc9bc0c8442ae644f2d5125e9
parent 8419c86c6871f880cd17a6cc29146d3d2da0477a
author Yasuyuki Kozakai <[email protected]> Fri, 11 Aug 2006 21:00:58 +0200 committer Patrick McHardy <[email protected]> Fri, 11 Aug 2006 21:00:58 +0200
include/linux/netfilter/xt_DSCP.h | 20 +++++ include/linux/netfilter_ipv4/ipt_DSCP.h | 6 - net/ipv4/netfilter/Kconfig | 11 --- net/ipv4/netfilter/Makefile | 1 net/ipv4/netfilter/ipt_DSCP.c | 96 ----------------------- net/netfilter/Kconfig | 12 +++ net/netfilter/Makefile | 1 net/netfilter/xt_DSCP.c | 130 +++++++++++++++++++++++++++++++ 8 files changed, 165 insertions(+), 112 deletions(-)
include/linux/netfilter/xt_DSCP.h new file +20 -0
@@ -0,0 +1,20 @@ +/* x_tables module for setting the IPv4/IPv6 DSCP field +* +* (C) 2002 Harald Welte <[email protected]> +* based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <[email protected]> +* This software is distributed under GNU GPL v2, 1991 +* +* See RFC2474 for a description of the DSCP field within the IP Header. +* +* xt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp +*/ +#ifndef _XT_DSCP_TARGET_H +#define _XT_DSCP_TARGET_H +#include <linux/netfilter/xt_dscp.h> + +/* target info */ +struct xt_DSCP_info { +u_int8_t dscp; +}; + +#endif /* _XT_DSCP_TARGET_H */
include/linux/netfilter_ipv4/ipt_DSCP.h +2 -4
@@ -11,10 +11,8 @@#ifndef _IPT_DSCP_TARGET_H#define _IPT_DSCP_TARGET_H#include <linux/netfilter_ipv4/ipt_dscp.h> +#include <linux/netfilter/xt_DSCP.h> -/* target info */ -struct ipt_DSCP_info { -u_int8_t dscp; -}; +#define ipt_DSCP_info xt_DSCP_info#endif /* _IPT_DSCP_TARGET_H */
net/ipv4/netfilter/Kconfig +0 -11
@@ -557,17 +557,6 @@ config IP_NF_TARGET_ECN To compile it as a module, choose M here. If unsure, say N. -config IP_NF_TARGET_DSCP - tristate "DSCP target support" - depends on IP_NF_MANGLE - help - This option adds a `DSCP' match, which allows you to match against - the IPv4 header DSCP field (DSCP codepoint). - - The DSCP codepoint can have any value between 0x0 and 0x4f. - - To compile it as a module, choose M here. If unsure, say N. - config IP_NF_TARGET_TTL tristate 'TTL target support' depends on IP_NF_MANGLE
net/ipv4/netfilter/Makefile +0 -1
@@ -67,7 +67,6 @@ # targets obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o -obj-$(CONFIG_IP_NF_TARGET_DSCP) += ipt_DSCP.o obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o obj-$(CONFIG_IP_NF_TARGET_NETMAP) += ipt_NETMAP.o
net/ipv4/netfilter/ipt_DSCP.c deleted +0 -96
96 lines not on this page · raw message
net/netfilter/Kconfig +12 -0
@@ -148,6 +148,18 @@ config NETFILTER_XT_TARGET_CONNMARK <file:Documentation/modules.txt>. The module will be called ipt_CONNMARK.o. If unsure, say `N'. +config NETFILTER_XT_TARGET_DSCP + tristate '"DSCP" target support' + depends on NETFILTER_XTABLES + depends on IP_NF_MANGLE || IP6_NF_MANGLE + help + This option adds a `DSCP' target, which allows you to manipulate + the IPv4/IPv6 header DSCP field (differentiated services codepoint). + + The DSCP field can have any value between 0x0 and 0x3f inclusive. + + To compile it as a module, choose M here. If unsure, say N. + config NETFILTER_XT_TARGET_MARK tristate '"MARK" target support' depends on NETFILTER_XTABLES
net/netfilter/Makefile +1 -0
@@ -25,6 +25,7 @@ obj-$(CONFIG_NETFILTER_XTABLES) += x_tab # targets obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIFY) += xt_CLASSIFY.o obj-$(CONFIG_NETFILTER_XT_TARGET_CONNMARK) += xt_CONNMARK.o +obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o obj-$(CONFIG_NETFILTER_XT_TARGET_MARK) += xt_MARK.o obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o obj-$(CONFIG_NETFILTER_XT_TARGET_NOTRACK) += xt_NOTRACK.o
net/netfilter/xt_DSCP.c new file +130 -0
130 lines not on this page · raw message
PATCH 3/18 : ipt_recent: add module parameter for changing ownership of /proc/net/ipt_recent/*
In reply to Patrick McHardy[NETFILTER]: ipt_recent: add module parameter for changing ownership of /proc/net/ipt_recent/*
---
commit 55eeb35cfb789640cc0d3b179398b196286c5991
tree 7e5c77fd3c21372eeacca1c456a2c9bd49044517
parent aee6e3b681f66196cf3ec43b53b252b61f870f1a
author Daniel De Graaf <[email protected]> Fri, 11 Aug 2006 21:01:03 +0200 committer Patrick McHardy <[email protected]> Fri, 11 Aug 2006 21:01:03 +0200
net/ipv4/netfilter/ipt_recent.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
net/ipv4/netfilter/ipt_recent.c +8 -0
@@ -35,14 +35,20 @@ static unsigned int ip_list_tot = 100;static unsigned int ip_pkt_list_tot =20 ;static unsigned int ip_list_hash_size =0 ;static unsigned int ip_list_perms =0644 ; +static unsigned int ip_list_uid =0 ; +static unsigned int ip_list_gid =0 ;module_param (ip_list_tot, uint,0400 );module_param (ip_pkt_list_tot, uint,0400 );module_param (ip_list_hash_size, uint,0400 );module_param (ip_list_perms, uint,0400 ); +module_param (ip_list_uid, uint,0400 ); +module_param (ip_list_gid, uint,0400 );MODULE_PARM_DESC (ip_list_tot,"number of IPs to remember per list" );MODULE_PARM_DESC (ip_pkt_list_tot,"number of packets per IP to remember (max. 255)" );MODULE_PARM_DESC (ip_list_hash_size,"size of hash table used to look up IPs" );MODULE_PARM_DESC (ip_list_perms,"permissions on /proc/net/ipt_recent/* files" ); +MODULE_PARM_DESC (ip_list_uid,"owner of /proc/net/ipt_recent/* files" ); +MODULE_PARM_DESC (ip_list_gid,"owning group of /proc/net/ipt_recent/* files" );struct recent_entry {
@@ -274,6 +280,8 @@ #ifdef CONFIG_PROC_FS goto out; } t->proc->proc_fops = &recent_fops; + t->proc->uid = ip_list_uid; + t->proc->gid = ip_list_gid; t->proc->data = t;#endif spin_lock_bh (&recent_lock);
PATCH 4/18 : conntrack: introduce connection mark event
In reply to Patrick McHardy[NETFILTER]: conntrack: introduce connection mark event
This patch introduces the mark event. ctnetlink can use this to know if the mark needs to be dumped.
---
commit 706761e6047b57ee8fa33c2eca912ffc5f36bfa7
tree 450fe3c2d130148e1e88909f1ef6b2b2ae1c0496
parent 55eeb35cfb789640cc0d3b179398b196286c5991
author Pablo Neira Ayuso <[email protected]> Fri, 11 Aug 2006 21:01:12 +0200 committer Patrick McHardy <[email protected]> Fri, 11 Aug 2006 21:01:12 +0200
include/linux/netfilter/nf_conntrack_common.h | 4 ++++ net/netfilter/xt_CONNMARK.c | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-)
include/linux/netfilter/nf_conntrack_common.h +4 -0
@@ -125,6 +125,10 @@ enum ip_conntrack_events/* Counter highest bit has been set */ IPCT_COUNTER_FILLING_BIT =11 ,IPCT_COUNTER_FILLING = (1 <<IPCT_COUNTER_FILLING_BIT ), + +/* Mark is set */ +IPCT_MARK_BIT =12 , + IPCT_MARK = (1 << IPCT_MARK_BIT), }; enum ip_conntrack_expect_events {
net/netfilter/xt_CONNMARK.c +14 -2
@@ -52,13 +52,25 @@ target(struct sk_buff **pskb,switch (markinfo->mode) {case XT_CONNMARK_SET : newmark = (*ctmark & ~markinfo->mask) | markinfo->mark; -if (newmark != *ctmark) +if (newmark != *ctmark) { *ctmark = newmark; +#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS +ip_conntrack_event_cache (IPCT_MARK , *pskb); +#else +nf_conntrack_event_cache (IPCT_MARK , *pskb); +#endif + }break ;case XT_CONNMARK_SAVE : newmark = (*ctmark & ~markinfo->mask) | ((*pskb)->nfmark & markinfo->mask); -if (*ctmark != newmark) +if (*ctmark != newmark) { *ctmark = newmark; +#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS +ip_conntrack_event_cache (IPCT_MARK , *pskb); +#else +nf_conntrack_event_cache (IPCT_MARK , *pskb); +#endif + }break ;case XT_CONNMARK_RESTORE : nfmark = (*pskb)->nfmark;
PATCH 5/18 : ctnetlink: dump connection mark
In reply to Patrick McHardy[NETFILTER]: ctnetlink: dump connection mark
ctnetlink dumps the mark iif the event mark happened
---
commit 430bb812a0703f2faddbe92a097d0ef7289b963b
tree e2c09a86971ac58d9b4ed85bf5962a9e360bbf05
parent 706761e6047b57ee8fa33c2eca912ffc5f36bfa7
author Pablo Neira Ayuso <[email protected]> Fri, 11 Aug 2006 21:01:17 +0200 committer Patrick McHardy <[email protected]> Fri, 11 Aug 2006 21:01:17 +0200
net/ipv4/netfilter/ip_conntrack_netlink.c | 4 ++++ net/netfilter/nf_conntrack_netlink.c | 4 ++++ 2 files changed, 8 insertions(+), 0 deletions(-)
net/ipv4/netfilter/ip_conntrack_netlink.c +4 -0
@@ -385,6 +385,10 @@ static int ctnetlink_conntrack_event(str ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0) goto nfattr_failure; +if (events &IPCT_MARK + &&ctnetlink_dump_mark (skb, ct) <0 ) + goto nfattr_failure; + nlh->nlmsg_len = skb->tail - b;nfnetlink_send (skb,0 , group,0 );return NOTIFY_DONE ;
net/netfilter/nf_conntrack_netlink.c +4 -0
@@ -395,6 +395,10 @@ static int ctnetlink_conntrack_event(str ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0) goto nfattr_failure; +if (events &IPCT_MARK + &&ctnetlink_dump_mark (skb, ct) <0 ) + goto nfattr_failure; + nlh->nlmsg_len = skb->tail - b;nfnetlink_send (skb,0 , group,0 );return NOTIFY_DONE ;
PATCH 6/18 : ctnetlink: check for listeners before sending expectation events
In reply to Patrick McHardy[NETFILTER]: ctnetlink: check for listeners before sending expectation events
This patch uses nfnetlink_has_listeners to check for listeners in userspace.
---
commit 67b49f9ce48d6acb259d20a38bf1d131250a01c6
tree a68fa4897286bc09b28047f8de29f38c57301f51
parent 430bb812a0703f2faddbe92a097d0ef7289b963b
author Pablo Neira Ayuso <[email protected]> Fri, 11 Aug 2006 21:01:23 +0200 committer Patrick McHardy <[email protected]> Fri, 11 Aug 2006 21:01:23 +0200
net/ipv4/netfilter/ip_conntrack_netlink.c | 3 +++ net/netfilter/nf_conntrack_netlink.c | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-)
net/ipv4/netfilter/ip_conntrack_netlink.c +3 -0
@@ -1260,6 +1260,9 @@ static int ctnetlink_expect_event(struct }else return NOTIFY_DONE ; +if (!nfnetlink_has_listeners (NFNLGRP_CONNTRACK_EXP_NEW )) +return NOTIFY_DONE ; + skb =alloc_skb (NLMSG_GOODSIZE ,GFP_ATOMIC );if (!skb)return NOTIFY_DONE ;
net/netfilter/nf_conntrack_netlink.c +3 -0
@@ -1281,6 +1281,9 @@ static int ctnetlink_expect_event(struct }else return NOTIFY_DONE ; +if (!nfnetlink_has_listeners (NFNLGRP_CONNTRACK_EXP_NEW )) +return NOTIFY_DONE ; + skb =alloc_skb (NLMSG_GOODSIZE ,GFP_ATOMIC );if (!skb)return NOTIFY_DONE ;
PATCH 7/18 : ctnetlink: remove impossible events tests for updates
In reply to Patrick McHardy[NETFILTER]: ctnetlink: remove impossible events tests for updates
IPCT_HELPER and IPCT_NATINFO bits are never set on updates.
---
commit b27f40cbcae710e0b68589c9943499d8487a1590
tree 95dc47c638f174eec0c5ab68a1ad7cc9d966093f
parent 67b49f9ce48d6acb259d20a38bf1d131250a01c6
author Pablo Neira Ayuso <[email protected]> Fri, 11 Aug 2006 21:01:28 +0200 committer Patrick McHardy <[email protected]> Fri, 11 Aug 2006 21:01:28 +0200
net/ipv4/netfilter/ip_conntrack_netlink.c | 6 +----- net/netfilter/nf_conntrack_netlink.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-)
net/ipv4/netfilter/ip_conntrack_netlink.c +1 -5
@@ -329,11 +329,7 @@ static int ctnetlink_conntrack_event(str/* dump everything */ events = ~0UL ; group =NFNLGRP_CONNTRACK_NEW ; - }else if (events & (IPCT_STATUS | -IPCT_PROTOINFO | -IPCT_HELPER | -IPCT_HELPINFO | -IPCT_NATINFO )) { + }else if (events & (IPCT_STATUS |IPCT_PROTOINFO )) { type =IPCTNL_MSG_CT_NEW ; group =NFNLGRP_CONNTRACK_UPDATE ; }else
net/netfilter/nf_conntrack_netlink.c +1 -5
@@ -339,11 +339,7 @@ static int ctnetlink_conntrack_event(str/* dump everything */ events = ~0UL ; group =NFNLGRP_CONNTRACK_NEW ; - }else if (events & (IPCT_STATUS | -IPCT_PROTOINFO | -IPCT_HELPER | -IPCT_HELPINFO | -IPCT_NATINFO )) { + }else if (events & (IPCT_STATUS |IPCT_PROTOINFO )) { type =IPCTNL_MSG_CT_NEW ; group =NFNLGRP_CONNTRACK_UPDATE ; }else
PATCH 8/18 : nfnetlink_queue: fix typo in error message
In reply to Patrick McHardy[NETFILTER]: nfnetlink_queue: fix typo in error message
---
commit 94964e26cff67825112477f3c8bae88539245d72
tree f011d732bad268a2060caa362348665f690f5e66
parent b27f40cbcae710e0b68589c9943499d8487a1590
author Patrick McHardy <[email protected]> Fri, 11 Aug 2006 21:01:34 +0200 committer Patrick McHardy <[email protected]> Fri, 11 Aug 2006 21:01:34 +0200
net/netfilter/nfnetlink_queue.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nfnetlink_queue.c +2 -2
@@ -584,7 +584,7 @@ nfqnl_enqueue_packet(struct sk_buff *skb queue->queue_dropped++; status = -ENOSPC ;if (net_ratelimit ()) -printk (KERN_WARNING "ip_queue: full at %d entries, " +printk (KERN_WARNING "nf_queue: full at %d entries, " "dropping packets(s). Dropped: %d\n" , queue->queue_total, queue->queue_dropped); goto err_out_free_nskb;
@@ -635,7 +635,7 @@ nfqnl_mangle(void *data, int data_len, s diff, GFP_ATOMIC);if (newskb ==NULL ) { -printk (KERN_WARNING "ip_queue: OOM " +printk (KERN_WARNING "nf_queue: OOM " "in mangle, dropping packet\n" );return -ENOMEM ; }
PATCH 9/18 : replace open coded checksum updates
In reply to Patrick McHardy[NETFILTER]: replace open coded checksum updates
Replace open coded checksum update by nf_csum_update calls and clean up the surrounding code a bit.
---
commit 54ba0f09d3cb3d4ce48e4eb8cb9cae3ac60bade1
tree a34a4a57ebe2e4f12711b66f913a81fef9619713
parent 94964e26cff67825112477f3c8bae88539245d72
author Patrick McHardy <[email protected]> Fri, 11 Aug 2006 21:15:53 +0200 committer Patrick McHardy <[email protected]> Fri, 11 Aug 2006 21:15:53 +0200
net/ipv4/netfilter/ipt_ECN.c | 22 +++++++++------------- net/ipv4/netfilter/ipt_TOS.c | 22 ++++++++-------------- net/ipv4/netfilter/ipt_TTL.c | 9 +++------ 3 files changed, 20 insertions(+), 33 deletions(-)
net/ipv4/netfilter/ipt_ECN.c +9 -13
@@ -27,22 +27,18 @@ MODULE_DESCRIPTION("iptables ECN modificstatic inline int set_ect_ip (struct sk_buff **pskb,const struct ipt_ECN_info *einfo) { -if (((*pskb)->nh.iph->tos &IPT_ECN_IP_MASK ) - != (einfo->ip_ect &IPT_ECN_IP_MASK )) { -u_int16_t diffs[2 ]; +struct iphdr *iph = (*pskb)->nh.iph; +u_int16_t oldtos; +if ((iph->tos &IPT_ECN_IP_MASK ) != (einfo->ip_ect &IPT_ECN_IP_MASK )) {if (!skb_make_writable (pskb,sizeof (struct iphdr )))return 0 ; - - diffs[0 ] =htons ((*pskb)->nh.iph->tos) ^0xFFFF ; - (*pskb)->nh.iph->tos &= ~IPT_ECN_IP_MASK ; - (*pskb)->nh.iph->tos |= (einfo->ip_ect &IPT_ECN_IP_MASK ); - diffs[1 ] =htons ((*pskb)->nh.iph->tos); - (*pskb)->nh.iph->check - =csum_fold (csum_partial ((char *)diffs, -sizeof (diffs), - (*pskb)->nh.iph->check - ^0xFFFF )); + iph = (*pskb)->nh.iph; + oldtos = iph->tos; + iph->tos &= ~IPT_ECN_IP_MASK ; + iph->tos |= (einfo->ip_ect &IPT_ECN_IP_MASK ); + iph->check =nf_csum_update (oldtos ^0xFFFF , iph->tos, + iph->check); }return 1 ; }
net/ipv4/netfilter/ipt_TOS.c +8 -14
@@ -30,23 +30,17 @@ target(struct sk_buff **pskb, void *userinfo) {const struct ipt_tos_target_info *tosinfo = targinfo; +struct iphdr *iph = (*pskb)->nh.iph; +u_int16_t oldtos; -if (((*pskb)->nh.iph->tos &IPTOS_TOS_MASK ) != tosinfo->tos) { -u_int16_t diffs[2 ]; - +if ((iph->tos &IPTOS_TOS_MASK ) != tosinfo->tos) {if (!skb_make_writable (pskb,sizeof (struct iphdr )))return NF_DROP ; - - diffs[0 ] =htons ((*pskb)->nh.iph->tos) ^0xFFFF ; - (*pskb)->nh.iph->tos - = ((*pskb)->nh.iph->tos &IPTOS_PREC_MASK ) - | tosinfo->tos; - diffs[1 ] =htons ((*pskb)->nh.iph->tos); - (*pskb)->nh.iph->check - =csum_fold (csum_partial ((char *)diffs, -sizeof (diffs), - (*pskb)->nh.iph->check - ^0xFFFF )); + iph = (*pskb)->nh.iph; + oldtos = iph->tos; + iph->tos = (iph->tos &IPTOS_PREC_MASK ) | tosinfo->tos; + iph->check =nf_csum_update (oldtos ^0xFFFF , iph->tos, + iph->check); }return IPT_CONTINUE ; }
net/ipv4/netfilter/ipt_TTL.c +3 -6
@@ -27,7 +27,6 @@ ipt_ttl_target(struct sk_buff **pskb, {struct iphdr *iph;const struct ipt_TTL_info *info = targinfo; -u_int16_t diffs[2 ];int new_ttl;if (!skb_make_writable (pskb, (*pskb)->len))
@@ -55,12 +54,10 @@ ipt_ttl_target(struct sk_buff **pskb, }if (new_ttl != iph->ttl) { - diffs[0 ] =htons (((unsigned )iph->ttl) <<8 ) ^0xFFFF ; + iph->check =nf_csum_update ((iph->ttl <<8 ) ^0xFFFF , + new_ttl <<8 , + iph->check); iph->ttl = new_ttl; - diffs[1 ] =htons (((unsigned )iph->ttl) <<8 ); - iph->check =csum_fold (csum_partial ((char *)diffs, -sizeof (diffs), - iph->check^0xFFFF )); }return IPT_CONTINUE ;
PATCH 10/18 : xt_CONNMARK: use tabs for indentation
In reply to Patrick McHardy[NETFILTER]: xt_CONNMARK: use tabs for indentation
---
commit c3e06d8b091765def127afcc148835736d64fad5
tree cd0512e19c5b2958a06ac0c0bf22a018242787df
parent 54ba0f09d3cb3d4ce48e4eb8cb9cae3ac60bade1
author Patrick McHardy <[email protected]> Sun, 13 Aug 2006 17:19:50 +0200 committer Patrick McHardy <[email protected]> Sun, 13 Aug 2006 17:19:50 +0200
net/netfilter/xt_CONNMARK.c | 57 ++++++++++++++++++++++--------------------- 1 files changed, 29 insertions(+), 28 deletions(-)
net/netfilter/xt_CONNMARK.c +29 -28
@@ -49,36 +49,37 @@ target(struct sk_buff **pskb,u_int32_t *ctmark =nf_ct_get_mark (*pskb, &ctinfo);if (ctmark) { -switch (markinfo->mode) { -case XT_CONNMARK_SET : - newmark = (*ctmark & ~markinfo->mask) | markinfo->mark; -if (newmark != *ctmark) { - *ctmark = newmark; +switch (markinfo->mode) { +case XT_CONNMARK_SET : + newmark = (*ctmark & ~markinfo->mask) | markinfo->mark; +if (newmark != *ctmark) { + *ctmark = newmark;#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS -ip_conntrack_event_cache (IPCT_MARK , *pskb); +ip_conntrack_event_cache (IPCT_MARK , *pskb);#else -nf_conntrack_event_cache (IPCT_MARK , *pskb); +nf_conntrack_event_cache (IPCT_MARK , *pskb);#endif } -break ; -case XT_CONNMARK_SAVE : - newmark = (*ctmark & ~markinfo->mask) | ((*pskb)->nfmark & markinfo->mask); -if (*ctmark != newmark) { - *ctmark = newmark; +break ; +case XT_CONNMARK_SAVE : + newmark = (*ctmark & ~markinfo->mask) | + ((*pskb)->nfmark & markinfo->mask); +if (*ctmark != newmark) { + *ctmark = newmark;#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS -ip_conntrack_event_cache (IPCT_MARK , *pskb); +ip_conntrack_event_cache (IPCT_MARK , *pskb);#else -nf_conntrack_event_cache (IPCT_MARK , *pskb); +nf_conntrack_event_cache (IPCT_MARK , *pskb);#endif + } +break ; +case XT_CONNMARK_RESTORE : + nfmark = (*pskb)->nfmark; + diff = (*ctmark ^ nfmark) & markinfo->mask; +if (diff !=0 ) + (*pskb)->nfmark = nfmark ^ diff; +break ; } -break ; -case XT_CONNMARK_RESTORE : - nfmark = (*pskb)->nfmark; - diff = (*ctmark ^ nfmark) & markinfo->mask; -if (diff !=0 ) - (*pskb)->nfmark = nfmark ^ diff; -break ; - } }return XT_CONTINUE ;
@@ -95,17 +96,17 @@ checkentry(const char *tablename,struct xt_connmark_target_info *matchinfo = targinfo;if (matchinfo->mode ==XT_CONNMARK_RESTORE ) { -if (strcmp (tablename,"mangle" ) !=0 ) { -printk (KERN_WARNING "CONNMARK: restore can only be called from \"mangle\" table, not \"%s\"\n" , tablename); -return 0 ; - } +if (strcmp (tablename,"mangle" ) !=0 ) { +printk (KERN_WARNING "CONNMARK: restore can only be " +"called from \"mangle\" table, not \"%s\"\n" , + tablename); +return 0 ; + } } -if (matchinfo->mark >0xffffffff || matchinfo->mask >0xffffffff ) {printk (KERN_WARNING "CONNMARK: Only supports 32bit mark\n" );return 0 ; } -return 1 ; }
PATCH 11/18 : x_tables: add helpers for mass match/target registration
In reply to Patrick McHardy[NETFILTER]: x_tables: add helpers for mass match/target registration
---
commit 15e38196fbab0fbedc31889f45440b9fe6fdf257
tree 13de7a026236dacc50d6db347169b1132d30caff
parent c3e06d8b091765def127afcc148835736d64fad5
author Patrick McHardy <[email protected]> Sun, 13 Aug 2006 19:01:17 +0200 committer Patrick McHardy <[email protected]> Sun, 13 Aug 2006 19:01:17 +0200
include/linux/netfilter/x_tables.h | 5 +++ net/netfilter/x_tables.c | 60 ++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 0 deletions(-)
include/linux/netfilter/x_tables.h +5 -0
@@ -290,8 +290,13 @@ struct xt_table_infoextern int xt_register_target (struct xt_target *target);extern void xt_unregister_target (struct xt_target *target); +extern int xt_register_targets (struct xt_target *target,unsigned int n); +extern void xt_unregister_targets (struct xt_target *target,unsigned int n); +extern int xt_register_match (struct xt_match *target);extern void xt_unregister_match (struct xt_match *target); +extern int xt_register_matches (struct xt_match *match,unsigned int n); +extern void xt_unregister_matches (struct xt_match *match,unsigned int n); extern int xt_check_match(const struct xt_match *match, unsigned short family, unsigned int size, const char *table, unsigned int hook,
net/netfilter/x_tables.c +60 -0
72 lines not on this page · raw message
PATCH 12/18 : x_tables: make use of mass registation helpers
In reply to Patrick McHardy[NETFILTER]: x_tables: make use of mass registation helpers
---
commit 160a7782ed42f6295b9d68b18bda7eb1f37e86a0
tree 2c97b54f8e555aa4093c9aac8a824dfefc822b37
parent 15e38196fbab0fbedc31889f45440b9fe6fdf257
author Patrick McHardy <[email protected]> Sun, 13 Aug 2006 19:02:45 +0200 committer Patrick McHardy <[email protected]> Sun, 13 Aug 2006 19:02:45 +0200
net/ipv6/netfilter/ip6t_REJECT.c | 4 - net/netfilter/xt_CLASSIFY.c | 60 +++++++++------------ net/netfilter/xt_CONNMARK.c | 51 +++++++---------- net/netfilter/xt_CONNSECMARK.c | 57 ++++++++------------ net/netfilter/xt_DSCP.c | 51 +++++++---------- net/netfilter/xt_MARK.c | 84 +++++++++++------------------ net/netfilter/xt_NFQUEUE.c | 68 +++++++++-------------- net/netfilter/xt_NOTRACK.c | 47 ++++++---------- net/netfilter/xt_SECMARK.c | 55 ++++++++----------- net/netfilter/xt_comment.c | 45 ++++++--------- net/netfilter/xt_connbytes.c | 47 +++++++--------- net/netfilter/xt_connmark.c | 53 ++++++++---------- net/netfilter/xt_conntrack.c | 5 -- net/netfilter/xt_dccp.c | 51 +++++++---------- net/netfilter/xt_dscp.c | 47 +++++++--------- net/netfilter/xt_esp.c | 51 +++++++---------- net/netfilter/xt_helper.c | 52 ++++++++---------- net/netfilter/xt_length.c | 43 ++++++--------- net/netfilter/xt_limit.c | 47 +++++++--------- net/netfilter/xt_mac.c | 52 ++++++++---------- net/netfilter/xt_mark.c | 47 +++++++--------- net/netfilter/xt_multiport.c | 111 ++++++++++++++------------------------ net/netfilter/xt_physdev.c | 49 +++++++---------- net/netfilter/xt_pkttype.c | 44 ++++++--------- net/netfilter/xt_policy.c | 51 ++++++++--------- net/netfilter/xt_quota.c | 51 +++++++---------- net/netfilter/xt_sctp.c | 51 +++++++---------- net/netfilter/xt_state.c | 53 +++++++----------- net/netfilter/xt_statistic.c | 53 +++++++----------- net/netfilter/xt_string.c | 50 +++++++---------- net/netfilter/xt_tcpmss.c | 49 +++++++---------- net/netfilter/xt_tcpudp.c | 107 ++++++++++++++----------------------- 32 files changed, 679 insertions(+), 1007 deletions(-)
net/ipv6/netfilter/ip6t_REJECT.c +1 -3
@@ -257,9 +257,7 @@ static struct ip6t_target ip6t_reject_restatic int __init ip6t_reject_init (void ) { -if (ip6t_register_target (&ip6t_reject_reg)) -return -EINVAL ; -return 0 ; +return ip6t_register_target (&ip6t_reject_reg); } static void __exit ip6t_reject_fini(void)
net/netfilter/xt_CLASSIFY.c +27 -33
74 lines not on this page · raw message
net/netfilter/xt_CONNMARK.c +21 -30
66 lines not on this page · raw message
net/netfilter/xt_CONNSECMARK.c +23 -34
72 lines not on this page · raw message
net/netfilter/xt_DSCP.c +21 -30
65 lines not on this page · raw message
net/netfilter/xt_MARK.c +33 -51
98 lines not on this page · raw message
net/netfilter/xt_NFQUEUE.c +25 -43
82 lines not on this page · raw message
net/netfilter/xt_NOTRACK.c +18 -29
61 lines not on this page · raw message
net/netfilter/xt_SECMARK.c +22 -33
69 lines not on this page · raw message
net/netfilter/xt_comment.c +18 -27
59 lines not on this page · raw message
net/netfilter/xt_connbytes.c +21 -26
61 lines not on this page · raw message
net/netfilter/xt_connmark.c +22 -31
68 lines not on this page · raw message
net/netfilter/xt_conntrack.c +1 -4
@@ -241,11 +241,8 @@ static struct xt_match conntrack_match =static int __init xt_conntrack_init (void ) { -int ret;need_conntrack (); - ret =xt_register_match (&conntrack_match); - -return ret; +return xt_register_match (&conntrack_match); } static void __exit xt_conntrack_fini(void)
net/netfilter/xt_dccp.c +21 -30
75 lines not on this page · raw message
net/netfilter/xt_dscp.c +19 -28
61 lines not on this page · raw message
net/netfilter/xt_esp.c +21 -30
65 lines not on this page · raw message
net/netfilter/xt_helper.c +22 -30
67 lines not on this page · raw message
net/netfilter/xt_length.c +18 -25
57 lines not on this page · raw message
net/netfilter/xt_limit.c +19 -28
61 lines not on this page · raw message
net/netfilter/xt_mac.c +23 -29
66 lines not on this page · raw message
net/netfilter/xt_mark.c +19 -28
61 lines not on this page · raw message
net/netfilter/xt_multiport.c +41 -70
125 lines not on this page · raw message
net/netfilter/xt_physdev.c +20 -29
63 lines not on this page · raw message
net/netfilter/xt_pkttype.c +18 -26
58 lines not on this page · raw message
net/netfilter/xt_policy.c +22 -29
65 lines not on this page · raw message
net/netfilter/xt_quota.c +19 -32
65 lines not on this page · raw message
net/netfilter/xt_sctp.c +21 -30
65 lines not on this page · raw message
net/netfilter/xt_state.c +21 -32
68 lines not on this page · raw message
net/netfilter/xt_statistic.c +21 -32
67 lines not on this page · raw message
net/netfilter/xt_string.c +21 -29
64 lines not on this page · raw message
net/netfilter/xt_tcpmss.c +20 -29
63 lines not on this page · raw message
net/netfilter/xt_tcpudp.c +40 -67
121 lines not on this page · raw message
[NETFILTER]: x_tables: Fix typos after conversion to use mass registation helper
net/netfilter/xt_CONNSECMARK.c +4 -4
@@ -130,14 +130,14 @@ static struct xt_target xt_connsecmark_tstatic int __init xt_connsecmark_init (void ) {need_conntrack (); -return xt_register_targets (xt_connsecmark_targets, -ARRAY_SIZE (xt_connsecmark_targets)); +return xt_register_targets (xt_connsecmark_target, +ARRAY_SIZE (xt_connsecmark_target)); } static void __exit xt_connsecmark_fini(void) { -xt_unregister_targets (xt_connsecmark_targets, -ARRAY_SIZE (xt_connsecmark_targets)); +xt_unregister_targets (xt_connsecmark_target, +ARRAY_SIZE (xt_connsecmark_target)); }module_init (xt_connsecmark_init);
net/netfilter/xt_SECMARK.c +1 -1
@@ -111,7 +111,7 @@ static int checkentry(const char *tablenreturn 1 ; } -static struct xt_target xt_secmark_target = { +static struct xt_target xt_secmark_target[] = { { .name ="SECMARK" , .family =AF_INET ,
Re: [NETFILTER]: x_tables: Fix typos after conversion to use mass registation helper
From: Thomas Graf <[email protected]>
Date: Tue, 22 Aug 2006 22:48:17 +0200
Quoted 1 line
Signed-off-by Thomas Graf <[email protected]>
Applied, thanks a lot Thomas.
PATCH 13/18 : x_tables: remove unused argument to target functions
In reply to Patrick McHardy[NETFILTER]: x_tables: remove unused argument to target functions
---
commit 855a763072e92f8b1e4931003cc82a0b3ba1131d
tree e683e7d21c3d96032d90c0634a6d62c2473932ac
parent 160a7782ed42f6295b9d68b18bda7eb1f37e86a0
author Patrick McHardy <[email protected]> Sun, 13 Aug 2006 19:46:20 +0200 committer Patrick McHardy <[email protected]> Sun, 13 Aug 2006 19:46:20 +0200
include/linux/netfilter/x_tables.h | 3 +-- include/linux/netfilter_arp/arp_tables.h | 3 +-- include/linux/netfilter_ipv4/ip_tables.h | 3 +-- include/linux/netfilter_ipv6/ip6_tables.h | 3 +-- net/ipv4/netfilter/arp_tables.c | 9 +++------ net/ipv4/netfilter/arpt_mangle.c | 2 +- net/ipv4/netfilter/arptable_filter.c | 2 +- net/ipv4/netfilter/ip_nat_rule.c | 8 +++----- net/ipv4/netfilter/ip_tables.c | 9 +++------ net/ipv4/netfilter/ipt_CLUSTERIP.c | 3 +-- net/ipv4/netfilter/ipt_ECN.c | 3 +-- net/ipv4/netfilter/ipt_LOG.c | 3 +-- net/ipv4/netfilter/ipt_MASQUERADE.c | 3 +-- net/ipv4/netfilter/ipt_NETMAP.c | 3 +-- net/ipv4/netfilter/ipt_REDIRECT.c | 3 +-- net/ipv4/netfilter/ipt_REJECT.c | 3 +-- net/ipv4/netfilter/ipt_SAME.c | 3 +-- net/ipv4/netfilter/ipt_TCPMSS.c | 3 +-- net/ipv4/netfilter/ipt_TOS.c | 3 +-- net/ipv4/netfilter/ipt_TTL.c | 2 +- net/ipv4/netfilter/ipt_ULOG.c | 2 +- net/ipv4/netfilter/iptable_filter.c | 4 ++-- net/ipv4/netfilter/iptable_mangle.c | 4 ++-- net/ipv4/netfilter/iptable_raw.c | 2 +- net/ipv6/netfilter/ip6_tables.c | 9 +++------ net/ipv6/netfilter/ip6t_HL.c | 2 +- net/ipv6/netfilter/ip6t_LOG.c | 3 +-- net/ipv6/netfilter/ip6t_REJECT.c | 3 +-- net/ipv6/netfilter/ip6table_filter.c | 4 ++-- net/ipv6/netfilter/ip6table_mangle.c | 4 ++-- net/ipv6/netfilter/ip6table_raw.c | 2 +- net/netfilter/xt_CLASSIFY.c | 3 +-- net/netfilter/xt_CONNMARK.c | 3 +-- net/netfilter/xt_CONNSECMARK.c | 2 +- net/netfilter/xt_DSCP.c | 6 ++---- net/netfilter/xt_MARK.c | 6 ++---- net/netfilter/xt_NFQUEUE.c | 3 +-- net/netfilter/xt_NOTRACK.c | 3 +-- net/netfilter/xt_SECMARK.c | 2 +- net/netfilter/xt_connbytes.c | 2 +- net/sched/act_ipt.c | 3 +-- 41 files changed, 55 insertions(+), 91 deletions(-)
include/linux/netfilter/x_tables.h +1 -2
@@ -211,8 +211,7 @@ struct xt_targetconst struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userdata); + const void *targinfo);/* Called when user tries to insert an entry of this type: hook_mask is a bitmask of hooks from which it can be
include/linux/netfilter_arp/arp_tables.h +1 -2
@@ -248,8 +248,7 @@ extern unsigned int arpt_do_table(structunsigned int hook, const struct net_device *in, const struct net_device *out, - struct arpt_table *table, - void *userdata); + struct arpt_table *table);#define ARPT_ALIGN (s) (((s) + (__alignof__(struct arpt_entry)-1)) & ~(__alignof__(struct arpt_entry)-1))#endif /*__KERNEL__*/
include/linux/netfilter_ipv4/ip_tables.h +1 -2
@@ -312,8 +312,7 @@ extern unsigned int ipt_do_table(structunsigned int hook, const struct net_device *in, const struct net_device *out, - struct ipt_table *table, - void *userdata); + struct ipt_table *table);#define IPT_ALIGN (s) XT_ALIGN(s)
include/linux/netfilter_ipv6/ip6_tables.h +1 -2
@@ -300,8 +300,7 @@ extern unsigned int ip6t_do_table(structunsigned int hook, const struct net_device *in, const struct net_device *out, - struct ip6t_table *table, - void *userdata); + struct ip6t_table *table);/* Check for an extension */ extern int ip6t_ext_hdr (u8 nexthdr);
net/ipv4/netfilter/arp_tables.c +3 -6
@@ -208,8 +208,7 @@ static unsigned int arpt_error(struct sk const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { if (net_ratelimit()) printk("arp_tables: error: '%s'\n", (char *)targinfo);
@@ -226,8 +225,7 @@ unsigned int arpt_do_table(struct sk_bufunsigned int hook, const struct net_device *in, const struct net_device *out, - struct arpt_table *table, - void *userdata) + struct arpt_table *table) { static const char nulldevname[IFNAMSIZ];unsigned int verdict =NF_DROP ;
@@ -301,8 +299,7 @@ unsigned int arpt_do_table(struct sk_buf in, out, hook, t->u.kernel.target, - t->data, - userdata); + t->data);/* Target might have changed stuff. */ arp = (*pskb)->nh.arph;
net/ipv4/netfilter/arpt_mangle.c +1 -1
@@ -11,7 +11,7 @@ static unsigned int target(struct sk_buff **pskb, const struct net_device *in, const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, void *userinfo) + const void *targinfo) { const struct arpt_mangle *mangle = targinfo;struct arphdr *arp;
net/ipv4/netfilter/arptable_filter.c +1 -1
@@ -155,7 +155,7 @@ static unsigned int arpt_hook(unsigned i const struct net_device *out, int (*okfn)(struct sk_buff *)) { - return arpt_do_table(pskb, hook, in, out, &packet_filter, NULL); + return arpt_do_table(pskb, hook, in, out, &packet_filter); } static struct nf_hook_ops arpt_ops[] = {
net/ipv4/netfilter/ip_nat_rule.c +3 -5
@@ -104,8 +104,7 @@ static unsigned int ipt_snat_target(struconst struct net_device *out, unsigned int hooknum, const struct ipt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { struct ip_conntrack *ct;enum ip_conntrack_info ctinfo;
@@ -147,8 +146,7 @@ static unsigned int ipt_dnat_target(struconst struct net_device *out, unsigned int hooknum, const struct ipt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { struct ip_conntrack *ct;enum ip_conntrack_info ctinfo;
@@ -255,7 +253,7 @@ int ip_nat_rule_find(struct sk_buff **ps {int ret; - ret =ipt_do_table (pskb, hooknum, in, out, &nat_table,NULL ); + ret =ipt_do_table (pskb, hooknum, in, out, &nat_table);if (ret ==NF_ACCEPT ) {if (!ip_nat_initialized (ct,HOOK2MANIP (hooknum)))
net/ipv4/netfilter/ip_tables.c +3 -6
@@ -180,8 +180,7 @@ ipt_error(struct sk_buff **pskb, const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { if (net_ratelimit()) printk("ip_tables: error: `%s'\n", (char *)targinfo);
@@ -217,8 +216,7 @@ ipt_do_table(struct sk_buff **pskb,unsigned int hook, const struct net_device *in, const struct net_device *out, - struct ipt_table *table, - void *userdata) + struct ipt_table *table) { static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));u_int16_t offset;
@@ -307,8 +305,7 @@ #endif in, out, hook, t->u.kernel.target, - t->data, - userdata); + t->data);#ifdef CONFIG_NETFILTER_DEBUG if (((struct ipt_entry *)table_base)->comefrom
net/ipv4/netfilter/ipt_CLUSTERIP.c +1 -2
@@ -302,8 +302,7 @@ target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct ipt_clusterip_tgt_info *cipinfo = targinfo;enum ip_conntrack_info ctinfo;
net/ipv4/netfilter/ipt_ECN.c +1 -2
@@ -85,8 +85,7 @@ target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct ipt_ECN_info *einfo = targinfo;
net/ipv4/netfilter/ipt_LOG.c +1 -2
@@ -416,8 +416,7 @@ ipt_log_target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct ipt_log_info *loginfo = targinfo;struct nf_loginfo li;
net/ipv4/netfilter/ipt_MASQUERADE.c +1 -2
@@ -64,8 +64,7 @@ masquerade_target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { struct ip_conntrack *ct;enum ip_conntrack_info ctinfo;
net/ipv4/netfilter/ipt_NETMAP.c +1 -2
@@ -55,8 +55,7 @@ target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { struct ip_conntrack *ct;enum ip_conntrack_info ctinfo;
net/ipv4/netfilter/ipt_REDIRECT.c +1 -2
@@ -58,8 +58,7 @@ redirect_target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { struct ip_conntrack *ct;enum ip_conntrack_info ctinfo;
net/ipv4/netfilter/ipt_REJECT.c +1 -2
@@ -228,8 +228,7 @@ static unsigned int reject(struct sk_bufconst struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct ipt_reject_info *reject = targinfo;
net/ipv4/netfilter/ipt_SAME.c +1 -2
@@ -133,8 +133,7 @@ same_target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { struct ip_conntrack *ct;enum ip_conntrack_info ctinfo;
net/ipv4/netfilter/ipt_TCPMSS.c +1 -2
@@ -41,8 +41,7 @@ ipt_tcpmss_target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct ipt_tcpmss_info *tcpmssinfo = targinfo;struct tcphdr *tcph;
net/ipv4/netfilter/ipt_TOS.c +1 -2
@@ -26,8 +26,7 @@ target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct ipt_tos_target_info *tosinfo = targinfo;struct iphdr *iph = (*pskb)->nh.iph;
net/ipv4/netfilter/ipt_TTL.c +1 -1
@@ -23,7 +23,7 @@ static unsigned int ipt_ttl_target(struct sk_buff **pskb, const struct net_device *in, const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, void *userinfo) + const void *targinfo) { struct iphdr *iph;const struct ipt_TTL_info *info = targinfo;
net/ipv4/netfilter/ipt_ULOG.c +1 -1
@@ -303,7 +303,7 @@ static unsigned int ipt_ulog_target(struconst struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, void *userinfo) + const void *targinfo) { struct ipt_ulog_info *loginfo = (struct ipt_ulog_info *) targinfo;
net/ipv4/netfilter/iptable_filter.c +2 -2
@@ -90,7 +90,7 @@ ipt_hook(unsigned int hook, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - return ipt_do_table(pskb, hook, in, out, &packet_filter, NULL); + return ipt_do_table(pskb, hook, in, out, &packet_filter); } static unsigned int
@@ -108,7 +108,7 @@ ipt_local_out_hook(unsigned int hook,return NF_ACCEPT ; } -return ipt_do_table (pskb, hook, in, out, &packet_filter,NULL ); +return ipt_do_table (pskb, hook, in, out, &packet_filter); }static struct nf_hook_ops ipt_ops[] = {
net/ipv4/netfilter/iptable_mangle.c +2 -2
@@ -119,7 +119,7 @@ ipt_route_hook(unsigned int hook, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - return ipt_do_table(pskb, hook, in, out, &packet_mangler, NULL); + return ipt_do_table(pskb, hook, in, out, &packet_mangler); } static unsigned int
@@ -148,7 +148,7 @@ ipt_local_hook(unsigned int hook, daddr = (*pskb)->nh.iph->daddr; tos = (*pskb)->nh.iph->tos; - ret =ipt_do_table (pskb, hook, in, out, &packet_mangler,NULL ); + ret =ipt_do_table (pskb, hook, in, out, &packet_mangler);/* Reroute for ANY change. */ if (ret != NF_DROP && ret != NF_STOLEN && ret != NF_QUEUE && ((*pskb)->nh.iph->saddr != saddr
net/ipv4/netfilter/iptable_raw.c +1 -1
@@ -95,7 +95,7 @@ ipt_hook(unsigned int hook, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - return ipt_do_table(pskb, hook, in, out, &packet_raw, NULL); + return ipt_do_table(pskb, hook, in, out, &packet_raw); }/* 'raw' is the very first table. */
net/ipv6/netfilter/ip6_tables.c +3 -6
@@ -220,8 +220,7 @@ ip6t_error(struct sk_buff **pskb, const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { if (net_ratelimit()) printk("ip6_tables: error: `%s'\n", (char *)targinfo);
@@ -258,8 +257,7 @@ ip6t_do_table(struct sk_buff **pskb,unsigned int hook, const struct net_device *in, const struct net_device *out, - struct xt_table *table, - void *userdata) + struct xt_table *table) { static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));int offset =0 ;
@@ -349,8 +347,7 @@ #endif in, out, hook, t->u.kernel.target, - t->data, - userdata); + t->data);#ifdef CONFIG_NETFILTER_DEBUG if (((struct ip6t_entry *)table_base)->comefrom
net/ipv6/netfilter/ip6t_HL.c +1 -1
@@ -22,7 +22,7 @@ static unsigned int ip6t_hl_target(strucconst struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, void *userinfo) + const void *targinfo) { struct ipv6hdr *ip6h;const struct ip6t_HL_info *info = targinfo;
net/ipv6/netfilter/ip6t_LOG.c +1 -2
@@ -427,8 +427,7 @@ ip6t_log_target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct ip6t_log_info *loginfo = targinfo;struct nf_loginfo li;
net/ipv6/netfilter/ip6t_REJECT.c +1 -2
@@ -180,8 +180,7 @@ static unsigned int reject6_target(strucconst struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct ip6t_reject_info *reject = targinfo;
net/ipv6/netfilter/ip6table_filter.c +2 -2
@@ -108,7 +108,7 @@ ip6t_hook(unsigned int hook, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - return ip6t_do_table(pskb, hook, in, out, &packet_filter, NULL); + return ip6t_do_table(pskb, hook, in, out, &packet_filter); } static unsigned int
@@ -128,7 +128,7 @@ #if 0 }#endif -return ip6t_do_table (pskb, hook, in, out, &packet_filter,NULL ); +return ip6t_do_table (pskb, hook, in, out, &packet_filter); } static struct nf_hook_ops ip6t_ops[] = {
net/ipv6/netfilter/ip6table_mangle.c +2 -2
@@ -138,7 +138,7 @@ ip6t_route_hook(unsigned int hook, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - return ip6t_do_table(pskb, hook, in, out, &packet_mangler, NULL); + return ip6t_do_table(pskb, hook, in, out, &packet_mangler); } static unsigned int
@@ -174,7 +174,7 @@ #endif/* flowlabel and prio (includes version, which shouldn't change either */ flowlabel = *((u_int32_t *) (*pskb)->nh.ipv6h); - ret =ip6t_do_table (pskb, hook, in, out, &packet_mangler,NULL ); + ret =ip6t_do_table (pskb, hook, in, out, &packet_mangler); if (ret != NF_DROP && ret != NF_STOLEN && (memcmp(&(*pskb)->nh.ipv6h->saddr, &saddr, sizeof(saddr))
net/ipv6/netfilter/ip6table_raw.c +1 -1
@@ -122,7 +122,7 @@ ip6t_hook(unsigned int hook, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - return ip6t_do_table(pskb, hook, in, out, &packet_raw, NULL); + return ip6t_do_table(pskb, hook, in, out, &packet_raw); } static struct nf_hook_ops ip6t_ops[] = {
net/netfilter/xt_CLASSIFY.c +1 -2
@@ -29,8 +29,7 @@ target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct xt_classify_target_info *clinfo = targinfo;
net/netfilter/xt_CONNMARK.c +1 -2
@@ -38,8 +38,7 @@ target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct xt_connmark_target_info *markinfo = targinfo;u_int32_t diff;
net/netfilter/xt_CONNSECMARK.c +1 -1
@@ -66,7 +66,7 @@ static void secmark_restore(struct sk_bustatic unsigned int target (struct sk_buff **pskb,const struct net_device *in,const struct net_device *out,unsigned int hooknum,const struct xt_target *target, -const void *targinfo,void *userinfo) +const void *targinfo) {struct sk_buff *skb = *pskb;const struct xt_connsecmark_target_info *info = targinfo;
net/netfilter/xt_DSCP.c +2 -4
@@ -32,8 +32,7 @@ static unsigned int target(struct sk_bufconst struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct xt_DSCP_info *dinfo = targinfo;u_int8_t dscp =ipv4_get_dsfield ((*pskb)->nh.iph) >>XT_DSCP_SHIFT ;
@@ -54,8 +53,7 @@ static unsigned int target6(struct sk_buconst struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct xt_DSCP_info *dinfo = targinfo;u_int8_t dscp =ipv6_get_dsfield ((*pskb)->nh.ipv6h) >>XT_DSCP_SHIFT ;
net/netfilter/xt_MARK.c +2 -4
@@ -27,8 +27,7 @@ target_v0(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct xt_mark_target_info *markinfo = targinfo;
@@ -44,8 +43,7 @@ target_v1(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct xt_mark_target_info_v1 *markinfo = targinfo;int mark =0 ;
net/netfilter/xt_NFQUEUE.c +1 -2
@@ -29,8 +29,7 @@ target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { const struct xt_NFQ_info *tinfo = targinfo;
net/netfilter/xt_NOTRACK.c +1 -2
@@ -16,8 +16,7 @@ target(struct sk_buff **pskb,const struct net_device *out, unsigned int hooknum, const struct xt_target *target, - const void *targinfo, - void *userinfo) + const void *targinfo) { /* Previously seen (loopback)? Ignore. */ if ((*pskb)->nfct != NULL)
net/netfilter/xt_SECMARK.c +1 -1
@@ -31,7 +31,7 @@ static u8 mode;static unsigned int target (struct sk_buff **pskb,const struct net_device *in,const struct net_device *out,unsigned int hooknum,const struct xt_target *target, -const void *targinfo,void *userinfo) +const void *targinfo) {u32 secmark =0 ;const struct xt_secmark_target_info *info = targinfo;
net/netfilter/xt_connbytes.c +1 -1
@@ -143,7 +143,7 @@ static int check(const char *tablename,return 1 ; } -static struct xt_match xt_connbytes_match = { +static struct xt_match xt_connbytes_match[] = { { .name ="connbytes" , .family =AF_INET ,
net/sched/act_ipt.c +1 -2
@@ -230,8 +230,7 @@ tcf_ipt(struct sk_buff *skb, struct tc_a* needs to be replaced. We don't own the skb, so this must not * happen. The pskb_expand_head above should make sure of this */ ret = p->t->u.kernel.target->target (&skb, skb->dev,NULL , p->hook, - p->t->u.kernel.target, p->t->data, -NULL ); + p->t->u.kernel.target, p->t->data);switch (ret) {case NF_ACCEPT : result =TC_ACT_OK ;
PATCH 14/18 : x_tables: remove unused size argument to check/destroy functions
In reply to Patrick McHardy[NETFILTER]: x_tables: remove unused size argument to check/destroy functions
The size is verified by x_tables and isn't needed by the modules anymore.
---
commit 0945146f9085ef6469e137000fd125df648a137f
tree 16818ec12cba09e961d6fc4ffa13026afbf2e07b
parent 855a763072e92f8b1e4931003cc82a0b3ba1131d
author Patrick McHardy <[email protected]> Sun, 13 Aug 2006 19:46:51 +0200 committer Patrick McHardy <[email protected]> Sun, 13 Aug 2006 19:46:51 +0200
include/linux/netfilter/x_tables.h | 8 ++------ net/ipv4/netfilter/arp_tables.c | 5 +---- net/ipv4/netfilter/arpt_mangle.c | 2 +- net/ipv4/netfilter/ip_nat_rule.c | 2 -- net/ipv4/netfilter/ip_tables.c | 14 +++----------- net/ipv4/netfilter/ipt_CLUSTERIP.c | 4 +--- net/ipv4/netfilter/ipt_ECN.c | 1 - net/ipv4/netfilter/ipt_LOG.c | 1 - net/ipv4/netfilter/ipt_MASQUERADE.c | 1 - net/ipv4/netfilter/ipt_NETMAP.c | 1 - net/ipv4/netfilter/ipt_REDIRECT.c | 1 - net/ipv4/netfilter/ipt_REJECT.c | 1 - net/ipv4/netfilter/ipt_SAME.c | 4 +--- net/ipv4/netfilter/ipt_TCPMSS.c | 1 - net/ipv4/netfilter/ipt_TOS.c | 1 - net/ipv4/netfilter/ipt_TTL.c | 1 - net/ipv4/netfilter/ipt_ULOG.c | 1 - net/ipv4/netfilter/ipt_ah.c | 1 - net/ipv4/netfilter/ipt_ecn.c | 3 +-- net/ipv4/netfilter/ipt_hashlimit.c | 4 +--- net/ipv4/netfilter/ipt_owner.c | 1 - net/ipv4/netfilter/ipt_recent.c | 5 ++--- net/ipv6/netfilter/ip6_tables.c | 10 ++-------- net/ipv6/netfilter/ip6t_HL.c | 1 - net/ipv6/netfilter/ip6t_LOG.c | 1 - net/ipv6/netfilter/ip6t_REJECT.c | 1 - net/ipv6/netfilter/ip6t_ah.c | 1 - net/ipv6/netfilter/ip6t_dst.c | 1 - net/ipv6/netfilter/ip6t_frag.c | 1 - net/ipv6/netfilter/ip6t_hbh.c | 1 - net/ipv6/netfilter/ip6t_ipv6header.c | 1 - net/ipv6/netfilter/ip6t_owner.c | 1 - net/ipv6/netfilter/ip6t_rt.c | 1 - net/netfilter/xt_CONNMARK.c | 1 - net/netfilter/xt_CONNSECMARK.c | 2 +- net/netfilter/xt_DSCP.c | 1 - net/netfilter/xt_MARK.c | 2 -- net/netfilter/xt_SECMARK.c | 2 +- net/netfilter/xt_connbytes.c | 1 - net/netfilter/xt_connmark.c | 3 +-- net/netfilter/xt_conntrack.c | 3 +-- net/netfilter/xt_dccp.c | 1 - net/netfilter/xt_dscp.c | 1 - net/netfilter/xt_esp.c | 1 - net/netfilter/xt_helper.c | 3 +-- net/netfilter/xt_limit.c | 1 - net/netfilter/xt_mark.c | 1 - net/netfilter/xt_multiport.c | 4 ---- net/netfilter/xt_physdev.c | 1 - net/netfilter/xt_policy.c | 3 +-- net/netfilter/xt_quota.c | 2 +- net/netfilter/xt_sctp.c | 1 - net/netfilter/xt_state.c | 3 +-- net/netfilter/xt_statistic.c | 2 +- net/netfilter/xt_string.c | 4 +--- net/netfilter/xt_tcpudp.c | 2 -- net/sched/act_ipt.c | 4 +--- 57 files changed, 26 insertions(+), 106 deletions(-)
include/linux/netfilter/x_tables.h +2 -6
@@ -174,12 +174,10 @@ struct xt_matchconst void *ip, const struct xt_match *match, void *matchinfo, - unsigned int matchinfosize, unsigned int hook_mask);/* Called when entry of this type deleted. */ -void (*destroy)(const struct xt_match *match,void *matchinfo, -unsigned int matchinfosize); +void (*destroy)(const struct xt_match *match,void *matchinfo);/* Called when userspace align differs from kernel space one */ int (*compat)(void *match,void **dstptr,int *size,int convert);
@@ -221,12 +219,10 @@ struct xt_targetconst void *entry, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask);/* Called when entry of this type deleted. */ -void (*destroy)(const struct xt_target *target,void *targinfo, -unsigned int targinfosize); +void (*destroy)(const struct xt_target *target,void *targinfo);/* Called when userspace align differs from kernel space one */ int (*compat)(void *target,void **dstptr,int *size,int convert);
net/ipv4/netfilter/arp_tables.c +1 -4
@@ -490,8 +490,6 @@ static inline int check_entry(struct arp } }else if (t->u.kernel.target->checkentry && !t->u.kernel.target->checkentry (name, e, target, t->data, - t->u.target_size - -sizeof (*t), e->comefrom)) {duprintf ("arp_tables: check failed for `%s'.\n" , t->u.kernel.target->name);
@@ -558,8 +556,7 @@ static inline int cleanup_entry(struct a t =arpt_get_target (e);if (t->u.kernel.target->destroy) - t->u.kernel.target->destroy (t->u.kernel.target, t->data, - t->u.target_size -sizeof (*t)); + t->u.kernel.target->destroy (t->u.kernel.target, t->data);module_put (t->u.kernel.target->me);return 0 ; }
net/ipv4/netfilter/arpt_mangle.c +1 -1
@@ -67,7 +67,7 @@ target(struct sk_buff **pskb,static int checkentry (const char *tablename,const void *e,const struct xt_target *target, -void *targinfo,unsigned int targinfosize,unsigned int hook_mask) +void *targinfo,unsigned int hook_mask) {const struct arpt_mangle *mangle = targinfo;
net/ipv4/netfilter/ip_nat_rule.c +0 -2
@@ -172,7 +172,6 @@ static int ipt_snat_checkentry(const chaconst void *entry, const struct ipt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { struct ip_nat_multi_range_compat *mr = targinfo;
@@ -189,7 +188,6 @@ static int ipt_dnat_checkentry(const chaconst void *entry, const struct ipt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { struct ip_nat_multi_range_compat *mr = targinfo;
net/ipv4/netfilter/ip_tables.c +3 -11
@@ -463,8 +463,7 @@ cleanup_match(struct ipt_entry_match *m,return 1 ;if (m->u.kernel.match->destroy) - m->u.kernel.match->destroy (m->u.kernel.match, m->data, - m->u.match_size -sizeof (*m)); + m->u.kernel.match->destroy (m->u.kernel.match, m->data);module_put (m->u.kernel.match->me);return 0 ; }
@@ -517,7 +516,6 @@ check_match(struct ipt_entry_match *m,if (m->u.kernel.match->checkentry && !m->u.kernel.match->checkentry (name, ip, match, m->data, - m->u.match_size -sizeof (*m), hookmask)) {duprintf ("ip_tables: check failed for `%s'.\n" , m->u.kernel.match->name);
@@ -578,8 +576,6 @@ check_entry(struct ipt_entry *e, const c } }else if (t->u.kernel.target->checkentry && !t->u.kernel.target->checkentry (name, e, target, t->data, - t->u.target_size - -sizeof (*t), e->comefrom)) {duprintf ("ip_tables: check failed for `%s'.\n" , t->u.kernel.target->name);
@@ -651,8 +647,7 @@ cleanup_entry(struct ipt_entry *e, unsigIPT_MATCH_ITERATE (e, cleanup_match,NULL ); t =ipt_get_target (e);if (t->u.kernel.target->destroy) - t->u.kernel.target->destroy (t->u.kernel.target, t->data, - t->u.target_size -sizeof (*t)); + t->u.kernel.target->destroy (t->u.kernel.target, t->data);module_put (t->u.kernel.target->me);return 0 ; }
@@ -1598,7 +1593,6 @@ static inline int compat_copy_match_fromif (m->u.kernel.match->checkentry && !m->u.kernel.match->checkentry (name, ip, match, dm->data, - dm->u.match_size -sizeof (*dm), hookmask)) {duprintf ("ip_tables: check failed for `%s'.\n" , m->u.kernel.match->name);
@@ -1657,8 +1651,7 @@ static int compat_copy_entry_from_user(s goto out; }else if (t->u.kernel.target->checkentry && !t->u.kernel.target->checkentry (name, de, target, - t->data, t->u.target_size -sizeof (*t), - de->comefrom)) { + t->data, de->comefrom)) {duprintf ("ip_tables: compat: check failed for `%s'.\n" , t->u.kernel.target->name); goto out;
@@ -2181,7 +2174,6 @@ icmp_checkentry(const char *tablename,const void *info, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct ipt_icmp *icmpinfo = matchinfo;
net/ipv4/netfilter/ipt_CLUSTERIP.c +1 -3
@@ -372,7 +372,6 @@ checkentry(const char *tablename,const void *e_void, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { struct ipt_clusterip_tgt_info *cipinfo = targinfo;
@@ -449,8 +448,7 @@ checkentry(const char *tablename, }/* drop reference count of cluster config when rule is deleted */ -static void destroy (const struct xt_target *target,void *targinfo, -unsigned int targinfosize) +static void destroy (const struct xt_target *target,void *targinfo) {struct ipt_clusterip_tgt_info *cipinfo = targinfo;
net/ipv4/netfilter/ipt_ECN.c +0 -1
@@ -106,7 +106,6 @@ checkentry(const char *tablename,const void *e_void, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const struct ipt_ECN_info *einfo = (struct ipt_ECN_info *)targinfo;
net/ipv4/netfilter/ipt_LOG.c +0 -1
@@ -439,7 +439,6 @@ static int ipt_log_checkentry(const charconst void *e, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const struct ipt_log_info *loginfo = targinfo;
net/ipv4/netfilter/ipt_MASQUERADE.c +0 -1
@@ -42,7 +42,6 @@ masquerade_check(const char *tablename,const void *e, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const struct ip_nat_multi_range_compat *mr = targinfo;
net/ipv4/netfilter/ipt_NETMAP.c +0 -1
@@ -33,7 +33,6 @@ check(const char *tablename,const void *e, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const struct ip_nat_multi_range_compat *mr = targinfo;
net/ipv4/netfilter/ipt_REDIRECT.c +0 -1
@@ -36,7 +36,6 @@ redirect_check(const char *tablename,const void *e, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const struct ip_nat_multi_range_compat *mr = targinfo;
net/ipv4/netfilter/ipt_REJECT.c +0 -1
@@ -276,7 +276,6 @@ static int check(const char *tablename,const void *e_void, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const struct ipt_reject_info *rejinfo = targinfo;
net/ipv4/netfilter/ipt_SAME.c +1 -3
@@ -52,7 +52,6 @@ same_check(const char *tablename,const void *e, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { unsigned int count, countess, rangeip, index = 0;
@@ -116,8 +115,7 @@ same_check(const char *tablename, }static void -same_destroy (const struct xt_target *target,void *targinfo, -unsigned int targinfosize) +same_destroy (const struct xt_target *target,void *targinfo) {struct ipt_same_info *mr = targinfo;
net/ipv4/netfilter/ipt_TCPMSS.c +0 -1
@@ -207,7 +207,6 @@ ipt_tcpmss_checkentry(const char *tablenconst void *e_void, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const struct ipt_tcpmss_info *tcpmssinfo = targinfo;
net/ipv4/netfilter/ipt_TOS.c +0 -1
@@ -49,7 +49,6 @@ checkentry(const char *tablename,const void *e_void, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const u_int8_t tos = ((struct ipt_tos_target_info *)targinfo)->tos;
net/ipv4/netfilter/ipt_TTL.c +0 -1
@@ -67,7 +67,6 @@ static int ipt_ttl_checkentry(const charconst void *e, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { struct ipt_TTL_info *info = targinfo;
net/ipv4/netfilter/ipt_ULOG.c +0 -1
@@ -341,7 +341,6 @@ static int ipt_ulog_checkentry(const chaconst void *e, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hookmask) { struct ipt_ulog_info *loginfo = (struct ipt_ulog_info *) targinfo;
net/ipv4/netfilter/ipt_ah.c +0 -1
@@ -74,7 +74,6 @@ checkentry(const char *tablename,const void *ip_void, const struct xt_match *match, void *matchinfo, - unsigned int matchinfosize, unsigned int hook_mask) { const struct ipt_ah *ahinfo = matchinfo;
net/ipv4/netfilter/ipt_ecn.c +1 -2
@@ -88,8 +88,7 @@ static int match(const struct sk_buff *sstatic int checkentry (const char *tablename,const void *ip_void,const struct xt_match *match, -void *matchinfo,unsigned int matchsize, -unsigned int hook_mask) +void *matchinfo,unsigned int hook_mask) {const struct ipt_ecn_info *info = matchinfo;const struct ipt_ip *ip = ip_void;
net/ipv4/netfilter/ipt_hashlimit.c +1 -3
@@ -478,7 +478,6 @@ hashlimit_checkentry(const char *tablenaconst void *inf, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { struct ipt_hashlimit_info *r = matchinfo;
@@ -529,8 +528,7 @@ hashlimit_checkentry(const char *tablena }static void -hashlimit_destroy (const struct xt_match *match,void *matchinfo, -unsigned int matchsize) +hashlimit_destroy (const struct xt_match *match,void *matchinfo) {struct ipt_hashlimit_info *r = matchinfo;
net/ipv4/netfilter/ipt_owner.c +0 -1
@@ -56,7 +56,6 @@ checkentry(const char *tablename,const void *ip, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct ipt_owner_info *info = matchinfo;
net/ipv4/netfilter/ipt_recent.c +2 -3
@@ -238,7 +238,7 @@ out:static int ipt_recent_checkentry (const char *tablename,const void *ip,const struct xt_match *match,void *matchinfo, -unsigned int matchsize,unsigned int hook_mask) +unsigned int hook_mask) {const struct ipt_recent_info *info = matchinfo;struct recent_table *t;
@@ -294,8 +294,7 @@ out: }static void -ipt_recent_destroy (const struct xt_match *match,void *matchinfo, -unsigned int matchsize) +ipt_recent_destroy (const struct xt_match *match,void *matchinfo) {const struct ipt_recent_info *info = matchinfo;struct recent_table *t;
net/ipv6/netfilter/ip6_tables.c +2 -8
@@ -504,8 +504,7 @@ cleanup_match(struct ip6t_entry_match *mreturn 1 ;if (m->u.kernel.match->destroy) - m->u.kernel.match->destroy (m->u.kernel.match, m->data, - m->u.match_size -sizeof (*m)); + m->u.kernel.match->destroy (m->u.kernel.match, m->data);module_put (m->u.kernel.match->me);return 0 ; }
@@ -558,7 +557,6 @@ check_match(struct ip6t_entry_match *m,if (m->u.kernel.match->checkentry && !m->u.kernel.match->checkentry (name, ipv6, match, m->data, - m->u.match_size -sizeof (*m), hookmask)) {duprintf ("ip_tables: check failed for `%s'.\n" , m->u.kernel.match->name);
@@ -619,8 +617,6 @@ check_entry(struct ip6t_entry *e, const } }else if (t->u.kernel.target->checkentry && !t->u.kernel.target->checkentry (name, e, target, t->data, - t->u.target_size - -sizeof (*t), e->comefrom)) {duprintf ("ip_tables: check failed for `%s'.\n" , t->u.kernel.target->name);
@@ -692,8 +688,7 @@ cleanup_entry(struct ip6t_entry *e, unsiIP6T_MATCH_ITERATE (e, cleanup_match,NULL ); t =ip6t_get_target (e);if (t->u.kernel.target->destroy) - t->u.kernel.target->destroy (t->u.kernel.target, t->data, - t->u.target_size -sizeof (*t)); + t->u.kernel.target->destroy (t->u.kernel.target, t->data);module_put (t->u.kernel.target->me);return 0 ; }
@@ -1349,7 +1344,6 @@ icmp6_checkentry(const char *tablename,const void *entry, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct ip6t_icmp *icmpinfo = matchinfo;
net/ipv6/netfilter/ip6t_HL.c +0 -1
@@ -66,7 +66,6 @@ static int ip6t_hl_checkentry(const charconst void *entry, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { struct ip6t_HL_info *info = targinfo;
net/ipv6/netfilter/ip6t_LOG.c +0 -1
@@ -451,7 +451,6 @@ static int ip6t_log_checkentry(const chaconst void *entry, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const struct ip6t_log_info *loginfo = targinfo;
net/ipv6/netfilter/ip6t_REJECT.c +0 -1
@@ -223,7 +223,6 @@ static int check(const char *tablename,const void *entry, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const struct ip6t_reject_info *rejinfo = targinfo;
net/ipv6/netfilter/ip6t_ah.c +0 -1
@@ -102,7 +102,6 @@ checkentry(const char *tablename,const void *entry, const struct xt_match *match, void *matchinfo, - unsigned int matchinfosize, unsigned int hook_mask) { const struct ip6t_ah *ahinfo = matchinfo;
net/ipv6/netfilter/ip6t_dst.c +0 -1
@@ -182,7 +182,6 @@ checkentry(const char *tablename,const void *info, const struct xt_match *match, void *matchinfo, - unsigned int matchinfosize, unsigned int hook_mask) { const struct ip6t_opts *optsinfo = matchinfo;
net/ipv6/netfilter/ip6t_frag.c +0 -1
@@ -119,7 +119,6 @@ checkentry(const char *tablename,const void *ip, const struct xt_match *match, void *matchinfo, - unsigned int matchinfosize, unsigned int hook_mask) { const struct ip6t_frag *fraginfo = matchinfo;
net/ipv6/netfilter/ip6t_hbh.c +0 -1
@@ -182,7 +182,6 @@ checkentry(const char *tablename,const void *entry, const struct xt_match *match, void *matchinfo, - unsigned int matchinfosize, unsigned int hook_mask) { const struct ip6t_opts *optsinfo = matchinfo;
net/ipv6/netfilter/ip6t_ipv6header.c +0 -1
@@ -128,7 +128,6 @@ ipv6header_checkentry(const char *tablenconst void *ip, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct ip6t_ipv6header_info *info = matchinfo;
net/ipv6/netfilter/ip6t_owner.c +0 -1
@@ -57,7 +57,6 @@ checkentry(const char *tablename,const void *ip, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct ip6t_owner_info *info = matchinfo;
net/ipv6/netfilter/ip6t_rt.c +0 -1
@@ -197,7 +197,6 @@ checkentry(const char *tablename,const void *entry, const struct xt_match *match, void *matchinfo, - unsigned int matchinfosize, unsigned int hook_mask) { const struct ip6t_rt *rtinfo = matchinfo;
net/netfilter/xt_CONNMARK.c +0 -1
@@ -89,7 +89,6 @@ checkentry(const char *tablename,const void *entry, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { struct xt_connmark_target_info *matchinfo = targinfo;
net/netfilter/xt_CONNSECMARK.c +1 -1
@@ -89,7 +89,7 @@ static unsigned int target(struct sk_bufstatic int checkentry (const char *tablename,const void *entry,const struct xt_target *target,void *targinfo, -unsigned int targinfosize,unsigned int hook_mask) +unsigned int hook_mask) {struct xt_connsecmark_target_info *info = targinfo;
net/netfilter/xt_DSCP.c +0 -1
@@ -72,7 +72,6 @@ static int checkentry(const char *tablenconst void *e_void, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { const u_int8_t dscp = ((struct xt_DSCP_info *)targinfo)->dscp;
net/netfilter/xt_MARK.c +0 -2
@@ -74,7 +74,6 @@ checkentry_v0(const char *tablename,const void *entry, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { struct xt_mark_target_info *markinfo = targinfo;
@@ -91,7 +90,6 @@ checkentry_v1(const char *tablename,const void *entry, const struct xt_target *target, void *targinfo, - unsigned int targinfosize, unsigned int hook_mask) { struct xt_mark_target_info_v1 *markinfo = targinfo;
net/netfilter/xt_SECMARK.c +1 -1
@@ -85,7 +85,7 @@ static int checkentry_selinux(struct xt_static int checkentry (const char *tablename,const void *entry,const struct xt_target *target,void *targinfo, -unsigned int targinfosize,unsigned int hook_mask) +unsigned int hook_mask) {struct xt_secmark_target_info *info = targinfo;
net/netfilter/xt_connbytes.c +0 -1
@@ -125,7 +125,6 @@ static int check(const char *tablename,const void *ip, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct xt_connbytes_info *sinfo = matchinfo;
net/netfilter/xt_connmark.c +1 -2
@@ -55,7 +55,6 @@ checkentry(const char *tablename,const void *ip, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { struct xt_connmark_info *cm = matchinfo;
@@ -75,7 +74,7 @@ #endif }static void -destroy (const struct xt_match *match,void *matchinfo,unsigned int matchsize) +destroy (const struct xt_match *match,void *matchinfo) {#if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )nf_ct_l3proto_module_put (match->family);
net/netfilter/xt_conntrack.c +1 -2
@@ -208,7 +208,6 @@ checkentry(const char *tablename,const void *ip, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
@@ -222,7 +221,7 @@ #endif }static void -destroy (const struct xt_match *match,void *matchinfo,unsigned int matchsize) +destroy (const struct xt_match *match,void *matchinfo) {#if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )nf_ct_l3proto_module_put (match->family);
net/netfilter/xt_dccp.c +0 -1
@@ -131,7 +131,6 @@ checkentry(const char *tablename,const void *inf, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct xt_dccp_info *info = matchinfo;
net/netfilter/xt_dscp.c +0 -1
@@ -58,7 +58,6 @@ static int checkentry(const char *tablenconst void *info, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const u_int8_t dscp = ((struct xt_dscp_info *)matchinfo)->dscp;
net/netfilter/xt_esp.c +0 -1
@@ -79,7 +79,6 @@ checkentry(const char *tablename,const void *ip_void, const struct xt_match *match, void *matchinfo, - unsigned int matchinfosize, unsigned int hook_mask) { const struct xt_esp *espinfo = matchinfo;
net/netfilter/xt_helper.c +1 -2
@@ -139,7 +139,6 @@ static int check(const char *tablename,const void *inf, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { struct xt_helper_info *info = matchinfo;
@@ -156,7 +155,7 @@ #endif }static void -destroy (const struct xt_match *match,void *matchinfo,unsigned int matchsize) +destroy (const struct xt_match *match,void *matchinfo) {#if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )nf_ct_l3proto_module_put (match->family);
net/netfilter/xt_limit.c +0 -1
@@ -110,7 +110,6 @@ ipt_limit_checkentry(const char *tablenaconst void *inf, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { struct xt_rateinfo *r = matchinfo;
net/netfilter/xt_mark.c +0 -1
@@ -39,7 +39,6 @@ checkentry(const char *tablename,const void *entry, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct xt_mark_info *minfo = matchinfo;
net/netfilter/xt_multiport.c +0 -4
@@ -176,7 +176,6 @@ checkentry(const char *tablename,const void *info, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct ipt_ip *ip = info;
@@ -191,7 +190,6 @@ checkentry_v1(const char *tablename,const void *info, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct ipt_ip *ip = info;
@@ -206,7 +204,6 @@ checkentry6(const char *tablename,const void *info, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct ip6t_ip6 *ip = info;
@@ -221,7 +218,6 @@ checkentry6_v1(const char *tablename,const void *info, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct ip6t_ip6 *ip = info;
net/netfilter/xt_physdev.c +0 -1
@@ -105,7 +105,6 @@ checkentry(const char *tablename,const void *ip, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct xt_physdev_info *info = matchinfo;
net/netfilter/xt_policy.c +1 -2
@@ -135,8 +135,7 @@ static int match(const struct sk_buff *sstatic int checkentry (const char *tablename,const void *ip_void,const struct xt_match *match, -void *matchinfo,unsigned int matchsize, -unsigned int hook_mask) +void *matchinfo,unsigned int hook_mask) {struct xt_policy_info *info = matchinfo;
net/netfilter/xt_quota.c +1 -1
@@ -39,7 +39,7 @@ match(const struct sk_buff *skb,static int checkentry (const char *tablename,const void *entry,const struct xt_match *match,void *matchinfo, -unsigned int matchsize,unsigned int hook_mask) +unsigned int hook_mask) {struct xt_quota_info *q = (struct xt_quota_info *)matchinfo;
net/netfilter/xt_sctp.c +0 -1
@@ -163,7 +163,6 @@ checkentry(const char *tablename,const void *inf, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct xt_sctp_info *info = matchinfo;
net/netfilter/xt_state.c +1 -2
@@ -48,7 +48,6 @@ static int check(const char *tablename,const void *inf, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
@@ -62,7 +61,7 @@ #endif }static void -destroy (const struct xt_match *match,void *matchinfo,unsigned int matchsize) +destroy (const struct xt_match *match,void *matchinfo) {#if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )nf_ct_l3proto_module_put (match->family);
net/netfilter/xt_statistic.c +1 -1
@@ -55,7 +55,7 @@ match(const struct sk_buff *skb,static int checkentry (const char *tablename,const void *entry,const struct xt_match *match,void *matchinfo, -unsigned int matchsize,unsigned int hook_mask) +unsigned int hook_mask) {struct xt_statistic_info *info = (struct xt_statistic_info *)matchinfo;
net/netfilter/xt_string.c +1 -3
@@ -46,7 +46,6 @@ static int checkentry(const char *tablenconst void *ip, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { struct xt_string_info *conf = matchinfo;
@@ -69,8 +68,7 @@ static int checkentry(const char *tablenreturn 1 ; } -static void destroy (const struct xt_match *match,void *matchinfo, -unsigned int matchsize) +static void destroy (const struct xt_match *match,void *matchinfo) {textsearch_destroy (STRING_TEXT_PRIV (matchinfo)->config); }
net/netfilter/xt_tcpudp.c +0 -2
@@ -141,7 +141,6 @@ tcp_checkentry(const char *tablename,const void *info, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct xt_tcp *tcpinfo = matchinfo;
@@ -190,7 +189,6 @@ udp_checkentry(const char *tablename,const void *info, const struct xt_match *match, void *matchinfo, - unsigned int matchsize, unsigned int hook_mask) { const struct xt_tcp *udpinfo = matchinfo;
net/sched/act_ipt.c +1 -3
@@ -76,7 +76,6 @@ ipt_init_target(struct ipt_entry_targetif (t->u.kernel.target->checkentry && !t->u.kernel.target->checkentry (table,NULL , t->u.kernel.target, t->data, - t->u.target_size -sizeof (*t), hook)) {DPRINTK ("ipt_init_target: check failed for `%s'.\n" , t->u.kernel.target->name);
@@ -91,8 +90,7 @@ static void ipt_destroy_target(struct ipt_entry_target *t) {if (t->u.kernel.target->destroy) - t->u.kernel.target->destroy (t->u.kernel.target, t->data, - t->u.target_size -sizeof (*t)); + t->u.kernel.target->destroy (t->u.kernel.target, t->data);module_put (t->u.kernel.target->me); }
PATCH 15/18 : nfnetlink: remove unnecessary packed attributes
In reply to Patrick McHardy[NETFILTER]: nfnetlink: remove unnecessary packed attributes
Remove unnecessary packed attributes in nfnetlink structures. Unfortunately in a few cases they have to stay to avoid changing structure sizes.
---
commit 9c8627cc82b512bf2c7d07f0a9afd9a6afc9e7ec
tree e8491a9be51317f39b98618dfee2564b27dca2c2
parent 0945146f9085ef6469e137000fd125df648a137f
author Patrick McHardy <[email protected]> Fri, 18 Aug 2006 04:38:47 +0200 committer Patrick McHardy <[email protected]> Fri, 18 Aug 2006 04:38:47 +0200
include/linux/netfilter/nfnetlink.h | 4 ++-- include/linux/netfilter/nfnetlink_log.h | 6 +++--- include/linux/netfilter/nfnetlink_queue.h | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-)
include/linux/netfilter/nfnetlink.h +2 -2
@@ -43,7 +43,7 @@ struct nfattru_int16_t nfa_len;u_int16_t nfa_type;/* we use 15 bits for the type, and the highest * bit to indicate whether the payload is nested */ -} __attribute__ ((packed)); +};/* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from * rtnetlink.h, it's time to put this in a generic file */
@@ -79,7 +79,7 @@ struct nfgenmsg {u_int8_t nfgen_family;/* AF_xxx */ u_int8_t version;/* nfnetlink version */ u_int16_t res_id;/* resource id */ -} __attribute__ ((packed)); +};#define NFNETLINK_V0 0
include/linux/netfilter/nfnetlink_log.h +3 -3
@@ -19,18 +19,18 @@ struct nfulnl_msg_packet_hdr {u_int16_t hw_protocol;/* hw protocol (network order) */ u_int8_t hook;/* netfilter hook */ u_int8_t _pad; -} __attribute__ ((packed)); +};struct nfulnl_msg_packet_hw {u_int16_t hw_addrlen;u_int16_t _pad;u_int8_t hw_addr[8 ]; -} __attribute__ ((packed)); +};struct nfulnl_msg_packet_timestamp {aligned_u64 sec;aligned_u64 usec; -} __attribute__ ((packed)); +};#define NFULNL_PREFIXLEN 30/* just like old log target */
include/linux/netfilter/nfnetlink_queue.h +4 -4
@@ -22,12 +22,12 @@ struct nfqnl_msg_packet_hw {u_int16_t hw_addrlen;u_int16_t _pad;u_int8_t hw_addr[8 ]; -} __attribute__ ((packed)); +};struct nfqnl_msg_packet_timestamp {aligned_u64 sec;aligned_u64 usec; -} __attribute__ ((packed)); +};enum nfqnl_attr_type {NFQA_UNSPEC ,
@@ -49,7 +49,7 @@ #define NFQA_MAX (__NFQA_MAX - 1)struct nfqnl_msg_verdict_hdr {u_int32_t verdict;u_int32_t id; -} __attribute__ ((packed)); +};enum nfqnl_msg_config_cmds {
@@ -64,7 +64,7 @@ struct nfqnl_msg_config_cmd {u_int8_t command;/* nfqnl_msg_config_cmds */ u_int8_t _pad;u_int16_t pf;/* AF_xxx for PF_[UN]BIND */ -} __attribute__ ((packed)); +};enum nfqnl_config_mode {NFQNL_COPY_NONE ,
PATCH 16/18 : x_tables: add data member to struct xt_match
In reply to Patrick McHardy[NETFILTER]: x_tables: add data member to struct xt_match
Shared match functions can use this to make runtime decisions basen on the used match.
---
commit 0da4cda5f20c851bf4a7da543d6eb91cad7810aa
tree 4f6bc6de8304515ddcfd03d99e876f13d7299190
parent 9c8627cc82b512bf2c7d07f0a9afd9a6afc9e7ec
author Patrick McHardy <[email protected]> Fri, 18 Aug 2006 06:06:17 +0200 committer Patrick McHardy <[email protected]> Fri, 18 Aug 2006 06:06:17 +0200
include/linux/netfilter/x_tables.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
include/linux/netfilter/x_tables.h +3 -0
@@ -185,6 +185,9 @@ struct xt_match/* Set this to THIS_MODULE if you are a module, otherwise NULL */ struct module *me; +/* Free to use by each match */ +unsigned long data; +char *table;unsigned int matchsize;unsigned int hooks;
PATCH 17/18 : ip6_tables: consolidate dst and hbh matches
In reply to Patrick McHardy[NETFILTER]: ip6_tables: consolidate dst and hbh matches
The matches are identical besides one looking for NEXTHDR_HOP, the other for NEXTHDR_DEST. Remove ip6t_dst.c and handle both in ip6t_hbh.c.
---
commit e60478517acbd24f288c0d579adaea625c3419fb
tree ff12a24846c7d1ba54c02426598db9f1dd3e348b
parent 0da4cda5f20c851bf4a7da543d6eb91cad7810aa
author Patrick McHardy <[email protected]> Tue, 22 Aug 2006 00:36:32 +0200 committer Patrick McHardy <[email protected]> Tue, 22 Aug 2006 00:36:32 +0200
net/ipv6/netfilter/Makefile | 2 net/ipv6/netfilter/ip6t_dst.c | 219 ----------------------------------------- net/ipv6/netfilter/ip6t_hbh.c | 48 ++++----- 3 files changed, 25 insertions(+), 244 deletions(-)
net/ipv6/netfilter/Makefile +1 -1
@@ -5,7 +5,7 @@ # # Link order matters here. obj-$(CONFIG_IP6_NF_IPTABLES) += ip6_tables.o obj-$(CONFIG_IP6_NF_MATCH_RT) += ip6t_rt.o -obj-$(CONFIG_IP6_NF_MATCH_OPTS) += ip6t_hbh.o ip6t_dst.o +obj-$(CONFIG_IP6_NF_MATCH_OPTS) += ip6t_hbh.o obj-$(CONFIG_IP6_NF_MATCH_IPV6HEADER) += ip6t_ipv6header.o obj-$(CONFIG_IP6_NF_MATCH_FRAG) += ip6t_frag.o obj-$(CONFIG_IP6_NF_MATCH_AH) += ip6t_ah.o
net/ipv6/netfilter/ip6t_dst.c deleted +0 -219
219 lines not on this page · raw message
net/ipv6/netfilter/ip6t_hbh.c +24 -24
76 lines not on this page · raw message
PATCH 18/18 : xt_tcpmss: minor cleanups
In reply to Patrick McHardy[NETFILTER]: xt_tcpmss: minor cleanups
- remove unused define
- remove useless wrapper function
- use new line for expression after condition
---
commit 3a498d6f9d66f93f9afbf00f552eaf817b404d78
tree d4cb9b42cc0a4faa611c301bab2e0c2f331d86ee
parent e60478517acbd24f288c0d579adaea625c3419fb
author Patrick McHardy <[email protected]> Tue, 22 Aug 2006 00:36:46 +0200 committer Patrick McHardy <[email protected]> Tue, 22 Aug 2006 00:36:46 +0200
net/netfilter/xt_tcpmss.c | 48 +++++++++++++++++---------------------------- 1 files changed, 18 insertions(+), 30 deletions(-)
net/netfilter/xt_tcpmss.c +18 -30
@@ -18,21 +18,22 @@ #include <linux/netfilter/x_tables.h>#include <linux/netfilter_ipv4/ip_tables.h> #include <linux/netfilter_ipv6/ip6_tables.h> -#define TH_SYN 0x02 -MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Marc Boucher <[email protected]>" );MODULE_DESCRIPTION ("iptables TCP MSS match module" );MODULE_ALIAS ("ipt_tcpmss" ); -/* Returns 1 if the mss option is set and matched by the range, 0 otherwise */ -static inline int -mssoption_match (u_int16_t min,u_int16_t max, -const struct sk_buff *skb, -unsigned int protoff, -int invert, -int *hotdrop) +static int +match (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, +int *hotdrop) { +const struct xt_tcpmss_match_info *info = matchinfo;struct tcphdr _tcph, *th;/* tcp.doff is only 4 bits, ie. max 15 * 4 bytes */ u8 _opt[15 *4 -sizeof (_tcph)], *op;
@@ -64,35 +65,22 @@ mssoption_match(u_int16_t min, u_int16_t mssval = (op[i+2 ] <<8 ) | op[i+3 ]; -return (mssval >= min && mssval <= max) ^ invert; +return (mssval >= info->mss_min && + mssval <= info->mss_max) ^ info->invert; } -if (op[i] <2 ) i++; -else i += op[i+1 ]?:1 ; +if (op[i] <2 ) + i++; +else + i += op[i+1 ] ? :1 ; } out: -return invert; +return info->invert; - dropit: +dropit: *hotdrop =1 ;return 0 ; } -static int -match (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, -int *hotdrop) -{ -const struct xt_tcpmss_match_info *info = matchinfo; - -return mssoption_match (info->mss_min, info->mss_max, skb, protoff, - info->invert, hotdrop); -} -static struct xt_match xt_tcpmss_match[] = { { .name ="tcpmss" ,
David Miller
maintainerFrom: Patrick McHardy <[email protected]>
Date: Tue, 22 Aug 2006 00:52:18 +0200 (MEST)
Quoted 5 lines
following is my first batch of netfilter patches for 2.6.19. Mostly cleanups and code consolidation and a few ctnetlink updates - it looks a lot larger than it is :)
Please apply, thanks.
All applied, thanks a lot Patrick.
I realise that Dave knows what to do with these patches, can I check:
are these to be applied to 2.6.18-rc4, 2.6.18-rc4-git1 or some private build used to make 2.6.19 ?
I'm trying not to miss any previous submitted patches that these may depend upon that may have been sent to 2.6.18-private and maybe not made it public yet.
Perhaps I need to download Dave's or Patrick's git tree?
Sam
Quoted 9 lines · Amin Azez
I realise that Dave knows what to do with these patches, can I check:
are these to be applied to 2.6.18-rc4, 2.6.18-rc4-git1 or some private build used to make 2.6.19 ?I'm trying not to miss any previous submitted patches that these may depend upon that may have been sent to 2.6.18-private and maybe not made it public yet.
Perhaps I need to download Dave's or Patrick's git tree?
They're in Dave's net-2.6.19 tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.19.git