Skip to contentSkip to conversation

: Netfilter update+fixes

NETFILTER00/07 Applied Patrick McHardy 3 participants 17 messages Nov 2, 2007 – Nov 6, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Dave,

following are some minor netfilter updates, cleanups and fixes, consisting of an ipq seq-file conversion, some Makefile cleanups, removal of unneeded rcu_dereference calls in the NAT helpers, a nf_sockopt list helper cleanup and a fix for ebtables gratuitous arp matching.

Please apply, thanks.

 include/linux/netfilter/Kbuild      |   18 ++++++++--------
 include/linux/netfilter_ipv4/Kbuild |   28 +++++++++++++-------------
 include/linux/netfilter_ipv6/Kbuild |    2 +-
 net/bridge/netfilter/ebt_arp.c      |    2 +-
 net/ipv4/netfilter/Makefile         |   20 +++++++++---------
 net/ipv4/netfilter/ip_queue.c       |   37 ++++++++++++++++++----------------
 net/ipv4/netfilter/nf_nat_amanda.c  |    2 +-
 net/ipv4/netfilter/nf_nat_ftp.c     |    2 +-
 net/ipv4/netfilter/nf_nat_h323.c    |   18 ++++++++--------
 net/ipv4/netfilter/nf_nat_irc.c     |    2 +-
 net/ipv4/netfilter/nf_nat_pptp.c    |    8 +++---
 net/ipv4/netfilter/nf_nat_sip.c     |    4 +-
 net/ipv4/netfilter/nf_nat_tftp.c    |    2 +-
 net/ipv6/netfilter/Makefile         |   28 +++++++++++++++-----------
 net/ipv6/netfilter/ip6_queue.c      |   37 ++++++++++++++++++----------------
 net/netfilter/Makefile              |   14 ++++++------
 net/netfilter/nf_sockopt.c          |   13 +++--------
 net/netfilter/xt_connlimit.c        |    5 ++-
 net/netfilter/xt_time.c             |    3 +-
 net/netfilter/xt_u32.c              |    5 ++-
 20 files changed, 129 insertions(+), 121 deletions(-)

Alexey Dobriyan (2):
[NETFILTER]: ip{,6}_queue: convert to seq_file interface [NETFILTER]: nf_sockopts list head cleanup

Bart De Schuymer (1):

      [NETFILTER]: ebt_arp: fix --arp-gratuitous matching dependence on --arp-ip-{src,dst}

Jan Engelhardt (3):
[NETFILTER]: Copyright/Email update [NETFILTER]: Clean up Makefile [NETFILTER]: Sort matches/targets in Kbuild file

Patrick McHardy (1):
[NETFILTER]: remove unneeded rcu_dereference() calls

#1 lore raw

PATCH 1/7 : ip{,6}_queue: convert to seq_file interface

[NETFILTER]: ip{,6}_queue: convert to seq_file interface

I plan to kill ->get_info which means killing proc_net_create().

---
commit 9cfc1fadc1b0b5963fa8bef95f3653b8b2fb72b7
tree 9e4978bb689872525d1f4b656367ea65687a25a1
parent 54866f032307063776b4eff7eadb131d47f9f9b4
author Alexey Dobriyan <[email protected]> Fri, 02 Nov 2007 11:58:56 +0100 committer Patrick McHardy <[email protected]> Fri, 02 Nov 2007 11:58:56 +0100

 net/ipv4/netfilter/ip_queue.c  |   37 ++++++++++++++++++++-----------------
 net/ipv6/netfilter/ip6_queue.c |   37 ++++++++++++++++++++-----------------
 2 files changed, 40 insertions(+), 34 deletions(-)
net/ipv4/netfilter/ip_queue.c +20 -17
index 10a2ce0..14d64a3 100644
@@ -22,6 +22,7 @@
 #include <linux/spinlock.h>
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/security.h>
 #include <linux/mutex.h>
 #include <net/net_namespace.h>
@@ -607,15 +608,11 @@ static ctl_table ipq_root_table[] = {
 	{ .ctl_name = 0 }
 };
 
-#ifdef CONFIG_PROC_FS
-static int
-ipq_get_info(char *buffer, char **start, off_t offset, int length)
+static int ip_queue_show(struct seq_file *m, void *v)
 {
-	int len;
-
 	read_lock_bh(&queue_lock);
 
-	len = sprintf(buffer,
+	seq_printf(m,
 		      "Peer PID          : %d\n"
 		      "Copy mode         : %hu\n"
 		      "Copy range        : %u\n"
@@ -632,16 +629,21 @@ ipq_get_info(char *buffer, char **start, off_t offset, int length)
 		      queue_user_dropped);
 
 	read_unlock_bh(&queue_lock);
+	return 0;
+}
 
-	*start = buffer + offset;
-	len -= offset;
-	if (len > length)
-		len = length;
-	else if (len < 0)
-		len = 0;
-	return len;
+static int ip_queue_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ip_queue_show, NULL);
 }
-#endif /* CONFIG_PROC_FS */
+
+static const struct file_operations ip_queue_proc_fops = {
+	.open		= ip_queue_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+	.owner		= THIS_MODULE,
+};
 
 static struct nf_queue_handler nfqh = {
 	.name	= "ip_queue",
@@ -661,10 +663,11 @@ static int __init ip_queue_init(void)
 		goto cleanup_netlink_notifier;
 	}
 
-	proc = proc_net_create(&init_net, IPQ_PROC_FS_NAME, 0, ipq_get_info);
-	if (proc)
+	proc = create_proc_entry(IPQ_PROC_FS_NAME, 0, init_net.proc_net);
+	if (proc) {
 		proc->owner = THIS_MODULE;
-	else {
+		proc->proc_fops = &ip_queue_proc_fops;
+	} else {
 		printk(KERN_ERR "ip_queue: failed to create proc entry\n");
 		goto cleanup_ipqnl;
 	}
net/ipv6/netfilter/ip6_queue.c +20 -17
index 6413a30..e273605 100644
@@ -23,6 +23,7 @@
 #include <linux/spinlock.h>
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/mutex.h>
 #include <net/net_namespace.h>
 #include <net/sock.h>
@@ -596,15 +597,11 @@ static ctl_table ipq_root_table[] = {
 	{ .ctl_name = 0 }
 };
 
-#ifdef CONFIG_PROC_FS
-static int
-ipq_get_info(char *buffer, char **start, off_t offset, int length)
+static int ip6_queue_show(struct seq_file *m, void *v)
 {
-	int len;
-
 	read_lock_bh(&queue_lock);
 
-	len = sprintf(buffer,
+	seq_printf(m,
 		      "Peer PID          : %d\n"
 		      "Copy mode         : %hu\n"
 		      "Copy range        : %u\n"
@@ -621,16 +618,21 @@ ipq_get_info(char *buffer, char **start, off_t offset, int length)
 		      queue_user_dropped);
 
 	read_unlock_bh(&queue_lock);
+	return 0;
+}
 
-	*start = buffer + offset;
-	len -= offset;
-	if (len > length)
-		len = length;
-	else if (len < 0)
-		len = 0;
-	return len;
+static int ip6_queue_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ip6_queue_show, NULL);
 }
-#endif /* CONFIG_PROC_FS */
+
+static const struct file_operations ip6_queue_proc_fops = {
+	.open		= ip6_queue_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+	.owner		= THIS_MODULE,
+};
 
 static struct nf_queue_handler nfqh = {
 	.name	= "ip6_queue",
@@ -650,10 +652,11 @@ static int __init ip6_queue_init(void)
 		goto cleanup_netlink_notifier;
 	}
 
-	proc = proc_net_create(&init_net, IPQ_PROC_FS_NAME, 0, ipq_get_info);
-	if (proc)
+	proc = create_proc_entry(IPQ_PROC_FS_NAME, 0, init_net.proc_net);
+	if (proc) {
 		proc->owner = THIS_MODULE;
-	else {
+		proc->proc_fops = &ip6_queue_proc_fops;
+	} else {
 		printk(KERN_ERR "ip6_queue: failed to create proc entry\n");
 		goto cleanup_ipqnl;
 	}
#3 lore raw

PATCH 2/7 : Copyright/Email update

In reply to Patrick McHardy

[NETFILTER]: Copyright/Email update

Transfer all my copyright over to our company.

---
commit 94b462899348cbd662b8d0864c55a30a4700d52d
tree 2e90518d47f77c6b4b8b3f2b54f7cd54cde0bdfd
parent 9cfc1fadc1b0b5963fa8bef95f3653b8b2fb72b7
author Jan Engelhardt <[email protected]> Fri, 02 Nov 2007 11:58:56 +0100 committer Patrick McHardy <[email protected]> Fri, 02 Nov 2007 11:58:56 +0100

 net/netfilter/xt_connlimit.c |    5 +++--
 net/netfilter/xt_time.c      |    3 ++-
 net/netfilter/xt_u32.c       |    5 +++--
 3 files changed, 8 insertions(+), 5 deletions(-)
net/netfilter/xt_connlimit.c +3 -2
index 06cff1d..d7becf0 100644
@@ -4,7 +4,8 @@
  *   (c) 2000 Gerd Knorr <[email protected]>
  *   Nov 2002: Martin Bene <[email protected]>:
  *		only ignore TIME_WAIT or gone connections
- *   Copyright © Jan Engelhardt <[email protected]>, 2007
+ *   (C) CC Computer Consultants GmbH, 2007
+ *   Contact: <[email protected]>
  *
  * based on ...
  *
@@ -306,7 +307,7 @@ static void __exit xt_connlimit_exit(void)
 
 module_init(xt_connlimit_init);
 module_exit(xt_connlimit_exit);
-MODULE_AUTHOR("Jan Engelhardt <[email protected]>");
+MODULE_AUTHOR("Jan Engelhardt <[email protected]>");
 MODULE_DESCRIPTION("netfilter xt_connlimit match module");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("ipt_connlimit");
net/netfilter/xt_time.c +2 -1
index ef48bbd..ff44f86 100644
@@ -1,6 +1,7 @@
 /*
  *	xt_time
- *	Copyright © Jan Engelhardt <[email protected]>, 2007
+ *	Copyright © CC Computer Consultants GmbH, 2007
+ *	Contact: <[email protected]>
  *
  *	based on ipt_time by Fabrice MARIE <[email protected]>
  *	This is a module which is used for time matching
net/netfilter/xt_u32.c +3 -2
index bec4279..af75b8c 100644
@@ -2,7 +2,8 @@
  *	xt_u32 - kernel module to match u32 packet content
  *
  *	Original author: Don Cohen <[email protected]>
- *	© Jan Engelhardt <[email protected]>, 2007
+ *	(C) CC Computer Consultants GmbH, 2007
+ *	Contact: <[email protected]>
  */
 
 #include <linux/module.h>
@@ -129,7 +130,7 @@ static void __exit xt_u32_exit(void)
 
 module_init(xt_u32_init);
 module_exit(xt_u32_exit);
-MODULE_AUTHOR("Jan Engelhardt <[email protected]>");
+MODULE_AUTHOR("Jan Engelhardt <[email protected]>");
 MODULE_DESCRIPTION("netfilter u32 match module");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("ipt_u32");

-
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

#5 lore raw

PATCH 3/7 : Clean up Makefile

In reply to Patrick McHardy

[NETFILTER]: Clean up Makefile

Sort matches and targets in the NF makefiles.

---
commit af0bb06e1500a6ea534e94f1fd941865bce00b3d
tree 908e4884f12f52af95a3192efe25dbf3a399899b
parent 94b462899348cbd662b8d0864c55a30a4700d52d
author Jan Engelhardt <[email protected]> Fri, 02 Nov 2007 11:58:57 +0100 committer Patrick McHardy <[email protected]> Fri, 02 Nov 2007 11:58:57 +0100

 net/ipv4/netfilter/Makefile |   20 ++++++++++----------
 net/ipv6/netfilter/Makefile |   28 ++++++++++++++++------------
 net/netfilter/Makefile      |   14 +++++++-------
 3 files changed, 33 insertions(+), 29 deletions(-)
net/ipv4/netfilter/Makefile +10 -10
index 409d273..7456833 100644
@@ -41,27 +41,27 @@ obj-$(CONFIG_NF_NAT) += iptable_nat.o
 obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o
 
 # matches
+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_OWNER) += ipt_owner.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_AH) += ipt_ah.o
+obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
 obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o
-obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o
 
 # targets
-obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
-obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o
+obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o
 obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o
+obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.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
+obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
+obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
 obj-$(CONFIG_IP_NF_TARGET_SAME) += ipt_SAME.o
-obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
-obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o
-obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o
+obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o
 obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o
+obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o
 
 # generic ARP tables
 obj-$(CONFIG_IP_NF_ARPTABLES) += arp_tables.o
net/ipv6/netfilter/Makefile +16 -12
index 4513eab..e789ec4 100644
@@ -4,25 +4,29 @@
 
 # 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
-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
-obj-$(CONFIG_IP6_NF_MATCH_EUI64) += ip6t_eui64.o
-obj-$(CONFIG_IP6_NF_MATCH_OWNER) += ip6t_owner.o
 obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o
 obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o
-obj-$(CONFIG_IP6_NF_TARGET_HL) += ip6t_HL.o
 obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o
-obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o
 obj-$(CONFIG_IP6_NF_RAW) += ip6table_raw.o
-obj-$(CONFIG_IP6_NF_MATCH_HL) += ip6t_hl.o
-obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o
-obj-$(CONFIG_IP6_NF_MATCH_MH) += ip6t_mh.o
 
 # objects for l3 independent conntrack
 nf_conntrack_ipv6-objs  :=  nf_conntrack_l3proto_ipv6.o nf_conntrack_proto_icmpv6.o nf_conntrack_reasm.o
 
 # l3 independent conntrack
 obj-$(CONFIG_NF_CONNTRACK_IPV6) += nf_conntrack_ipv6.o
+
+# matches
+obj-$(CONFIG_IP6_NF_MATCH_AH) += ip6t_ah.o
+obj-$(CONFIG_IP6_NF_MATCH_EUI64) += ip6t_eui64.o
+obj-$(CONFIG_IP6_NF_MATCH_FRAG) += ip6t_frag.o
+obj-$(CONFIG_IP6_NF_MATCH_HL) += ip6t_hl.o
+obj-$(CONFIG_IP6_NF_MATCH_IPV6HEADER) += ip6t_ipv6header.o
+obj-$(CONFIG_IP6_NF_MATCH_MH) += ip6t_mh.o
+obj-$(CONFIG_IP6_NF_MATCH_OPTS) += ip6t_hbh.o
+obj-$(CONFIG_IP6_NF_MATCH_OWNER) += ip6t_owner.o
+obj-$(CONFIG_IP6_NF_MATCH_RT) += ip6t_rt.o
+
+# targets
+obj-$(CONFIG_IP6_NF_TARGET_HL) += ip6t_HL.o
+obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o
+obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o
net/netfilter/Makefile +7 -7
index 93c58f9..ad0e36e 100644
@@ -40,15 +40,15 @@ obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o
 # targets
 obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIFY) += xt_CLASSIFY.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_CONNMARK) += xt_CONNMARK.o
+obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.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_NFLOG) += xt_NFLOG.o
+obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_NOTRACK) += xt_NOTRACK.o
-obj-$(CONFIG_NETFILTER_XT_TARGET_TRACE) += xt_TRACE.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_SECMARK) += xt_SECMARK.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_TCPMSS) += xt_TCPMSS.o
-obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o
+obj-$(CONFIG_NETFILTER_XT_TARGET_TRACE) += xt_TRACE.o
 
 # matches
 obj-$(CONFIG_NETFILTER_XT_MATCH_COMMENT) += xt_comment.o
@@ -59,22 +59,22 @@ 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_HASHLIMIT) += xt_hashlimit.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.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
 obj-$(CONFIG_NETFILTER_XT_MATCH_MARK) += xt_mark.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_MULTIPORT) += xt_multiport.o
-obj-$(CONFIG_NETFILTER_XT_MATCH_POLICY) += xt_policy.o
+obj-$(CONFIG_NETFILTER_XT_MATCH_PHYSDEV) += xt_physdev.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_PKTTYPE) += xt_pkttype.o
+obj-$(CONFIG_NETFILTER_XT_MATCH_POLICY) += xt_policy.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_QUOTA) += xt_quota.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_REALM) += xt_realm.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_SCTP) += xt_sctp.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_STATE) += xt_state.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_STATISTIC) += xt_statistic.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_STRING) += xt_string.o
-obj-$(CONFIG_NETFILTER_XT_MATCH_TIME) += xt_time.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_TCPMSS) += xt_tcpmss.o
-obj-$(CONFIG_NETFILTER_XT_MATCH_PHYSDEV) += xt_physdev.o
+obj-$(CONFIG_NETFILTER_XT_MATCH_TIME) += xt_time.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_U32) += xt_u32.o
-obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o
#7 lore raw

PATCH 4/7 : Sort matches/targets in Kbuild file

In reply to Patrick McHardy

[NETFILTER]: Sort matches/targets in Kbuild file

Sort matches and targets in the Kbuild file.

---
commit 5bbc87888870ac8831766b731f509a552e25815f
tree dbaae8867aa93a71478e09f1fda4826514e5f05f
parent af0bb06e1500a6ea534e94f1fd941865bce00b3d
author Jan Engelhardt <[email protected]> Fri, 02 Nov 2007 11:58:57 +0100 committer Patrick McHardy <[email protected]> Fri, 02 Nov 2007 11:58:57 +0100

 include/linux/netfilter/Kbuild      |   18 +++++++++---------
 include/linux/netfilter_ipv4/Kbuild |   28 ++++++++++++++--------------
 include/linux/netfilter_ipv6/Kbuild |    2 +-
 3 files changed, 24 insertions(+), 24 deletions(-)
include/linux/netfilter/Kbuild +9 -9
index f2eaea2..b87e83a 100644
@@ -4,25 +4,28 @@ header-y += nfnetlink_conntrack.h
 header-y += nfnetlink_log.h
 header-y += nfnetlink_queue.h
 header-y += xt_CLASSIFY.h
+header-y += xt_CONNMARK.h
+header-y += xt_CONNSECMARK.h
+header-y += xt_DSCP.h
+header-y += xt_MARK.h
+header-y += xt_NFLOG.h
+header-y += xt_NFQUEUE.h
+header-y += xt_SECMARK.h
+header-y += xt_TCPMSS.h
 header-y += xt_comment.h
 header-y += xt_connbytes.h
 header-y += xt_connmark.h
-header-y += xt_CONNMARK.h
 header-y += xt_conntrack.h
 header-y += xt_dccp.h
 header-y += xt_dscp.h
-header-y += xt_DSCP.h
 header-y += xt_esp.h
-header-y += xt_helper.h
 header-y += xt_hashlimit.h
+header-y += xt_helper.h
 header-y += xt_length.h
 header-y += xt_limit.h
 header-y += xt_mac.h
 header-y += xt_mark.h
-header-y += xt_MARK.h
 header-y += xt_multiport.h
-header-y += xt_NFQUEUE.h
-header-y += xt_NFLOG.h
 header-y += xt_pkttype.h
 header-y += xt_policy.h
 header-y += xt_realm.h
@@ -32,9 +35,6 @@ header-y += xt_statistic.h
 header-y += xt_string.h
 header-y += xt_tcpmss.h
 header-y += xt_tcpudp.h
-header-y += xt_SECMARK.h
-header-y += xt_CONNSECMARK.h
-header-y += xt_TCPMSS.h
 
 unifdef-y += nf_conntrack_common.h
 unifdef-y += nf_conntrack_ftp.h
include/linux/netfilter_ipv4/Kbuild +14 -14
index 7185792..3a7105b 100644
@@ -1,47 +1,47 @@
-header-y += ipt_addrtype.h
-header-y += ipt_ah.h
 header-y += ipt_CLASSIFY.h
 header-y += ipt_CLUSTERIP.h
+header-y += ipt_CONNMARK.h
+header-y += ipt_DSCP.h
+header-y += ipt_ECN.h
+header-y += ipt_LOG.h
+header-y += ipt_MARK.h
+header-y += ipt_NFQUEUE.h
+header-y += ipt_REJECT.h
+header-y += ipt_SAME.h
+header-y += ipt_TCPMSS.h
+header-y += ipt_TOS.h
+header-y += ipt_TTL.h
+header-y += ipt_ULOG.h
+header-y += ipt_addrtype.h
+header-y += ipt_ah.h
 header-y += ipt_comment.h
 header-y += ipt_connbytes.h
 header-y += ipt_connmark.h
-header-y += ipt_CONNMARK.h
 header-y += ipt_conntrack.h
 header-y += ipt_dccp.h
 header-y += ipt_dscp.h
-header-y += ipt_DSCP.h
 header-y += ipt_ecn.h
-header-y += ipt_ECN.h
 header-y += ipt_esp.h
 header-y += ipt_hashlimit.h
 header-y += ipt_helper.h
 header-y += ipt_iprange.h
 header-y += ipt_length.h
 header-y += ipt_limit.h
-header-y += ipt_LOG.h
 header-y += ipt_mac.h
 header-y += ipt_mark.h
-header-y += ipt_MARK.h
 header-y += ipt_multiport.h
-header-y += ipt_NFQUEUE.h
 header-y += ipt_owner.h
 header-y += ipt_physdev.h
 header-y += ipt_pkttype.h
 header-y += ipt_policy.h
 header-y += ipt_realm.h
 header-y += ipt_recent.h
-header-y += ipt_REJECT.h
-header-y += ipt_SAME.h
 header-y += ipt_sctp.h
 header-y += ipt_state.h
 header-y += ipt_string.h
 header-y += ipt_tcpmss.h
-header-y += ipt_TCPMSS.h
 header-y += ipt_tos.h
-header-y += ipt_TOS.h
 header-y += ipt_ttl.h
-header-y += ipt_TTL.h
-header-y += ipt_ULOG.h
 
 unifdef-y += ip_queue.h
 unifdef-y += ip_tables.h
include/linux/netfilter_ipv6/Kbuild +1 -1
index 9dd978d..8887a5f 100644
@@ -14,8 +14,8 @@ header-y += ip6t_mark.h
 header-y += ip6t_multiport.h
 header-y += ip6t_opts.h
 header-y += ip6t_owner.h
-header-y += ip6t_policy.h
 header-y += ip6t_physdev.h
+header-y += ip6t_policy.h
 header-y += ip6t_rt.h
 
 unifdef-y += ip6_tables.h
#9 lore raw

PATCH 5/7 : remove unneeded rcu_dereference() calls

In reply to Patrick McHardy

[NETFILTER]: remove unneeded rcu_dereference() calls

As noticed by Paul McKenney, the rcu_dereference calls in the init path of NAT modules are unneeded, remove them.

---
commit 04a6b70568aa679cdce548f4edaac0a668440c60
tree 7be457d2896edddeaf07f503928338f1b8f850d0
parent 5bbc87888870ac8831766b731f509a552e25815f
author Patrick McHardy <[email protected]> Fri, 02 Nov 2007 11:58:57 +0100 committer Patrick McHardy <[email protected]> Fri, 02 Nov 2007 11:58:57 +0100

 net/ipv4/netfilter/nf_nat_amanda.c |    2 +-
 net/ipv4/netfilter/nf_nat_ftp.c    |    2 +-
 net/ipv4/netfilter/nf_nat_h323.c   |   18 +++++++++---------
 net/ipv4/netfilter/nf_nat_irc.c    |    2 +-
 net/ipv4/netfilter/nf_nat_pptp.c   |    8 ++++----
 net/ipv4/netfilter/nf_nat_sip.c    |    4 ++--
 net/ipv4/netfilter/nf_nat_tftp.c   |    2 +-
 7 files changed, 19 insertions(+), 19 deletions(-)
net/ipv4/netfilter/nf_nat_amanda.c +1 -1
index 35a5aa6..c31b876 100644
@@ -69,7 +69,7 @@ static void __exit nf_nat_amanda_fini(void)
 
 static int __init nf_nat_amanda_init(void)
 {
-	BUG_ON(rcu_dereference(nf_nat_amanda_hook));
+	BUG_ON(nf_nat_amanda_hook != NULL);
 	rcu_assign_pointer(nf_nat_amanda_hook, help);
 	return 0;
 }
net/ipv4/netfilter/nf_nat_ftp.c +1 -1
index e1a16d3..a1d5d58 100644
@@ -147,7 +147,7 @@ static void __exit nf_nat_ftp_fini(void)
 
 static int __init nf_nat_ftp_init(void)
 {
-	BUG_ON(rcu_dereference(nf_nat_ftp_hook));
+	BUG_ON(nf_nat_ftp_hook != NULL);
 	rcu_assign_pointer(nf_nat_ftp_hook, nf_nat_ftp);
 	return 0;
 }
net/ipv4/netfilter/nf_nat_h323.c +9 -9
index a868c8c..93e18ef 100644
@@ -544,15 +544,15 @@ static int nat_callforwarding(struct sk_buff *skb, struct nf_conn *ct,
 /****************************************************************************/
 static int __init init(void)
 {
-	BUG_ON(rcu_dereference(set_h245_addr_hook) != NULL);
-	BUG_ON(rcu_dereference(set_h225_addr_hook) != NULL);
-	BUG_ON(rcu_dereference(set_sig_addr_hook) != NULL);
-	BUG_ON(rcu_dereference(set_ras_addr_hook) != NULL);
-	BUG_ON(rcu_dereference(nat_rtp_rtcp_hook) != NULL);
-	BUG_ON(rcu_dereference(nat_t120_hook) != NULL);
-	BUG_ON(rcu_dereference(nat_h245_hook) != NULL);
-	BUG_ON(rcu_dereference(nat_callforwarding_hook) != NULL);
-	BUG_ON(rcu_dereference(nat_q931_hook) != NULL);
+	BUG_ON(set_h245_addr_hook != NULL);
+	BUG_ON(set_h225_addr_hook != NULL);
+	BUG_ON(set_sig_addr_hook != NULL);
+	BUG_ON(set_ras_addr_hook != NULL);
+	BUG_ON(nat_rtp_rtcp_hook != NULL);
+	BUG_ON(nat_t120_hook != NULL);
+	BUG_ON(nat_h245_hook != NULL);
+	BUG_ON(nat_callforwarding_hook != NULL);
+	BUG_ON(nat_q931_hook != NULL);
 
 	rcu_assign_pointer(set_h245_addr_hook, set_h245_addr);
 	rcu_assign_pointer(set_h225_addr_hook, set_h225_addr);
net/ipv4/netfilter/nf_nat_irc.c +1 -1
index 766e2c1..fe6f9ce 100644
@@ -74,7 +74,7 @@ static void __exit nf_nat_irc_fini(void)
 
 static int __init nf_nat_irc_init(void)
 {
-	BUG_ON(rcu_dereference(nf_nat_irc_hook));
+	BUG_ON(nf_nat_irc_hook != NULL);
 	rcu_assign_pointer(nf_nat_irc_hook, help);
 	return 0;
 }
net/ipv4/netfilter/nf_nat_pptp.c +4 -4
index e1385a0..6817e79 100644
@@ -281,16 +281,16 @@ static int __init nf_nat_helper_pptp_init(void)
 {
 	nf_nat_need_gre();
 
-	BUG_ON(rcu_dereference(nf_nat_pptp_hook_outbound));
+	BUG_ON(nf_nat_pptp_hook_outbound != NULL);
 	rcu_assign_pointer(nf_nat_pptp_hook_outbound, pptp_outbound_pkt);
 
-	BUG_ON(rcu_dereference(nf_nat_pptp_hook_inbound));
+	BUG_ON(nf_nat_pptp_hook_inbound != NULL);
 	rcu_assign_pointer(nf_nat_pptp_hook_inbound, pptp_inbound_pkt);
 
-	BUG_ON(rcu_dereference(nf_nat_pptp_hook_exp_gre));
+	BUG_ON(nf_nat_pptp_hook_exp_gre != NULL);
 	rcu_assign_pointer(nf_nat_pptp_hook_exp_gre, pptp_exp_gre);
 
-	BUG_ON(rcu_dereference(nf_nat_pptp_hook_expectfn));
+	BUG_ON(nf_nat_pptp_hook_expectfn != NULL);
 	rcu_assign_pointer(nf_nat_pptp_hook_expectfn, pptp_nat_expected);
 	return 0;
 }
net/ipv4/netfilter/nf_nat_sip.c +2 -2
index ce9edbc..3ca9897 100644
@@ -293,8 +293,8 @@ static void __exit nf_nat_sip_fini(void)
 
 static int __init nf_nat_sip_init(void)
 {
-	BUG_ON(rcu_dereference(nf_nat_sip_hook));
-	BUG_ON(rcu_dereference(nf_nat_sdp_hook));
+	BUG_ON(nf_nat_sip_hook != NULL);
+	BUG_ON(nf_nat_sdp_hook != NULL);
 	rcu_assign_pointer(nf_nat_sip_hook, ip_nat_sip);
 	rcu_assign_pointer(nf_nat_sdp_hook, ip_nat_sdp);
 	return 0;
net/ipv4/netfilter/nf_nat_tftp.c +1 -1
index 0ecec70..1360a94 100644
@@ -43,7 +43,7 @@ static void __exit nf_nat_tftp_fini(void)
 
 static int __init nf_nat_tftp_init(void)
 {
-	BUG_ON(rcu_dereference(nf_nat_tftp_hook));
+	BUG_ON(nf_nat_tftp_hook != NULL);
 	rcu_assign_pointer(nf_nat_tftp_hook, help);
 	return 0;
 }
maintainer Applied
#10 lore raw

Re: [NETFILTER 05/07]: remove unneeded rcu_dereference() calls

From: Patrick McHardy <[email protected]>
Date: Fri, 2 Nov 2007 12:23:17 +0100 (MET)

Quoted 6 lines

[NETFILTER]: remove unneeded rcu_dereference() calls

As noticed by Paul McKenney, the rcu_dereference calls in the init path of NAT modules are unneeded, remove them.

Applied.

#11 lore raw

PATCH 6/7 : nf_sockopts list head cleanup

In reply to Patrick McHardy

[NETFILTER]: nf_sockopts list head cleanup

Code is using knowledge that nf_sockopt_ops::list list_head is first field in structure by using casts. Switch to list_for_each_entry() itetators while I am at it.

---
commit 430f032387ee5ed1babaac827c116493d79217d8
tree f75f080c68c90d3c879dbaba73aa3e136e88f4ef
parent 04a6b70568aa679cdce548f4edaac0a668440c60
author Alexey Dobriyan <[email protected]> Fri, 02 Nov 2007 11:58:58 +0100 committer Patrick McHardy <[email protected]> Fri, 02 Nov 2007 11:58:58 +0100

 net/netfilter/nf_sockopt.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)
net/netfilter/nf_sockopt.c +4 -9
index aa28315..2dfac32 100644
@@ -23,14 +23,13 @@ static inline int overlap(int min1, int max1, int min2, int max2)
 /* Functions to register sockopt ranges (exclusive). */
 int nf_register_sockopt(struct nf_sockopt_ops *reg)
 {
-	struct list_head *i;
+	struct nf_sockopt_ops *ops;
 	int ret = 0;
 
 	if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0)
 		return -EINTR;
 
-	list_for_each(i, &nf_sockopts) {
-		struct nf_sockopt_ops *ops = (struct nf_sockopt_ops *)i;
+	list_for_each_entry(ops, &nf_sockopts, list) {
 		if (ops->pf == reg->pf
 		    && (overlap(ops->set_optmin, ops->set_optmax,
 				reg->set_optmin, reg->set_optmax)
@@ -65,7 +64,6 @@ EXPORT_SYMBOL(nf_unregister_sockopt);
 static int nf_sockopt(struct sock *sk, int pf, int val,
 		      char __user *opt, int *len, int get)
 {
-	struct list_head *i;
 	struct nf_sockopt_ops *ops;
 	int ret;
 
@@ -75,8 +73,7 @@ static int nf_sockopt(struct sock *sk, int pf, int val,
 	if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0)
 		return -EINTR;
 
-	list_for_each(i, &nf_sockopts) {
-		ops = (struct nf_sockopt_ops *)i;
+	list_for_each_entry(ops, &nf_sockopts, list) {
 		if (ops->pf == pf) {
 			if (!try_module_get(ops->owner))
 				goto out_nosup;
@@ -124,7 +121,6 @@ EXPORT_SYMBOL(nf_getsockopt);
 static int compat_nf_sockopt(struct sock *sk, int pf, int val,
 			     char __user *opt, int *len, int get)
 {
-	struct list_head *i;
 	struct nf_sockopt_ops *ops;
 	int ret;
 
@@ -135,8 +131,7 @@ static int compat_nf_sockopt(struct sock *sk, int pf, int val,
 	if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0)
 		return -EINTR;
 
-	list_for_each(i, &nf_sockopts) {
-		ops = (struct nf_sockopt_ops *)i;
+	list_for_each_entry(ops, &nf_sockopts, list) {
 		if (ops->pf == pf) {
 			if (!try_module_get(ops->owner))
 				goto out_nosup;
maintainer Applied
#12 lore raw

Re: [NETFILTER 06/07]: nf_sockopts list head cleanup

From: Patrick McHardy <[email protected]>
Date: Fri, 2 Nov 2007 12:23:18 +0100 (MET)

Quoted 8 lines

[NETFILTER]: nf_sockopts list head cleanup

Code is using knowledge that nf_sockopt_ops::list list_head is first field in structure by using casts. Switch to list_for_each_entry() itetators while I am at it.

Applied.

#13 lore raw

PATCH 7/7 : ebt_arp: fix --arp-gratuitous matching dependence on --arp-ip-{src,dst}

In reply to Patrick McHardy

[NETFILTER]: ebt_arp: fix --arp-gratuitous matching dependence on --arp-ip-{src,dst}

Fix --arp-gratuitous matching dependence on --arp-ip-{src,dst}

---
commit f7cfef5c02de8bbd3421cbc90d0734eef78872bb
tree 67c36f2b2768d7067cd90e3425c4ae61bf8d9d32
parent 430f032387ee5ed1babaac827c116493d79217d8
author Bart De Schuymer <[email protected]> Fri, 02 Nov 2007 11:58:58 +0100 committer Patrick McHardy <[email protected]> Fri, 02 Nov 2007 11:58:58 +0100

 net/bridge/netfilter/ebt_arp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/bridge/netfilter/ebt_arp.c +1 -1
index 1a46952..1814139 100644
@@ -34,7 +34,7 @@ static int ebt_filter_arp(const struct sk_buff *skb, const struct net_device *in
 	   ah->ar_pro, EBT_ARP_PTYPE))
 		return EBT_NOMATCH;
 
-	if (info->bitmask & (EBT_ARP_SRC_IP | EBT_ARP_DST_IP)) {
+	if (info->bitmask & (EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_GRAT)) {
 		__be32 saddr, daddr, *sap, *dap;
 
 		if (ah->ar_pln != sizeof(__be32) || ah->ar_pro != htons(ETH_P_IP))

-
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

maintainer
#14 lore raw

Re: [NETFILTER 07/07]: ebt_arp: fix --arp-gratuitous matching dependence on --arp-ip-{src,dst}

From: Patrick McHardy <[email protected]>
Date: Fri, 2 Nov 2007 12:23:20 +0100 (MET)

Quoted 7 lines

[NETFILTER]: ebt_arp: fix --arp-gratuitous matching dependence on --arp-ip-{src,dst}

Fix --arp-gratuitous matching dependence on --arp-ip-{src,dst}

Applied.
-
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

#15 lore raw
In reply to Patrick McHardy

Dnia 02-11-2007, pią o godzinie 12:23 +0100, Patrick McHardy pisze:
[..]

Quoted 3 lines
 net/netfilter/xt_connlimit.c        |    5 ++-
 net/netfilter/xt_time.c             |    3 +-
 net/netfilter/xt_u32.c              |    5 ++-

Still there is no officialy released stable iptables source tar ball with connlimit, time and u32 support. It will be good release updated iptables (1.3.9 ?)

kloczek

-
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

#16 lore raw
Quoted 12 lines · Kłoczko Tomasz

Dnia 02-11-2007, pią o godzinie 12:23 +0100, Patrick McHardy pisze:
[..]

Quoted 4 lines
 net/netfilter/xt_connlimit.c        |    5 ++-
 net/netfilter/xt_time.c             |    3 +-
 net/netfilter/xt_u32.c              |    5 ++-

Still there is no officialy released stable iptables source tar ball with connlimit, time and u32 support. It will be good release updated iptables (1.3.9 ?)

There is a release candidate for 1.4.0. We'll probably release in the next couple of weeks.

-
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