All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port
@ 2011-06-09 12:12 kaber
  2011-06-09 12:12 ` [PATCH 1/3] netfilter: ipt_ecn: fix protocol check in ecn_mt_check() kaber
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: kaber @ 2011-06-09 12:12 UTC (permalink / raw)
  To: eric.dumazet, dave.taht; +Cc: netfilter-devel

These patches contain two fixes for the ipt_ecn match and an IPv6 capable
xtables port. Nothing particulary exciting in the patches, if noone spots
any problems I'll push the first two patches to net-2.6 and the third one
to net-next-2.6.

iptables patch will follow shortly.

Patrick McHardy (3):
      netfilter: ipt_ecn: fix protocol check in ecn_mt_check()
      netfilter: ipt_ecn: fix inversion for IP header ECN match
      netfilter: xtables: add an IPv6 capable version of the ECN match

 include/linux/netfilter/Kbuild   |    1 +
 include/linux/netfilter/xt_ecn.h |   33 +++++++
 net/ipv4/netfilter/Kconfig       |    9 --
 net/ipv4/netfilter/Makefile      |    1 -
 net/ipv4/netfilter/ipt_ecn.c     |  128 --------------------------
 net/netfilter/Kconfig            |    9 ++
 net/netfilter/Makefile           |    1 +
 net/netfilter/xt_ecn.c           |  187 ++++++++++++++++++++++++++++++++++++++
 8 files changed, 231 insertions(+), 138 deletions(-)
 create mode 100644 include/linux/netfilter/xt_ecn.h
 delete mode 100644 net/ipv4/netfilter/ipt_ecn.c
 create mode 100644 net/netfilter/xt_ecn.c


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] netfilter: ipt_ecn: fix protocol check in ecn_mt_check()
  2011-06-09 12:12 [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port kaber
@ 2011-06-09 12:12 ` kaber
  2011-06-09 12:12 ` [PATCH 2/3] netfilter: ipt_ecn: fix inversion for IP header ECN match kaber
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: kaber @ 2011-06-09 12:12 UTC (permalink / raw)
  To: eric.dumazet, dave.taht; +Cc: netfilter-devel

From: Patrick McHardy <kaber@trash.net>

Check for protocol inversion in ecn_mt_check() and remove the unnecessary
runtime check for IPPROTO_TCP in ecn_mt().

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 net/ipv4/netfilter/ipt_ecn.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/netfilter/ipt_ecn.c b/net/ipv4/netfilter/ipt_ecn.c
index af6e9c7..aaa85be 100644
--- a/net/ipv4/netfilter/ipt_ecn.c
+++ b/net/ipv4/netfilter/ipt_ecn.c
@@ -76,8 +76,6 @@ static bool ecn_mt(const struct sk_buff *skb, struct xt_action_param *par)
 			return false;
 
 	if (info->operation & (IPT_ECN_OP_MATCH_ECE|IPT_ECN_OP_MATCH_CWR)) {
-		if (ip_hdr(skb)->protocol != IPPROTO_TCP)
-			return false;
 		if (!match_tcp(skb, info, &par->hotdrop))
 			return false;
 	}
@@ -97,7 +95,7 @@ static int ecn_mt_check(const struct xt_mtchk_param *par)
 		return -EINVAL;
 
 	if (info->operation & (IPT_ECN_OP_MATCH_ECE|IPT_ECN_OP_MATCH_CWR) &&
-	    ip->proto != IPPROTO_TCP) {
+	    (ip->proto != IPPROTO_TCP || ip->invflags & IPT_INV_PROTO)) {
 		pr_info("cannot match TCP bits in rule for non-tcp packets\n");
 		return -EINVAL;
 	}
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] netfilter: ipt_ecn: fix inversion for IP header ECN match
  2011-06-09 12:12 [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port kaber
  2011-06-09 12:12 ` [PATCH 1/3] netfilter: ipt_ecn: fix protocol check in ecn_mt_check() kaber
@ 2011-06-09 12:12 ` kaber
  2011-06-09 12:12 ` [PATCH 3/3] netfilter: xtables: add an IPv6 capable version of the " kaber
  2011-06-09 13:16 ` [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port Jan Engelhardt
  3 siblings, 0 replies; 7+ messages in thread
From: kaber @ 2011-06-09 12:12 UTC (permalink / raw)
  To: eric.dumazet, dave.taht; +Cc: netfilter-devel

From: Patrick McHardy <kaber@trash.net>

Userspace allows to specify inversion for IP header ECN matches, the kernel
silently accepts it, but doesn't invert the match result.

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 net/ipv4/netfilter/ipt_ecn.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/netfilter/ipt_ecn.c b/net/ipv4/netfilter/ipt_ecn.c
index aaa85be..2b57e52 100644
--- a/net/ipv4/netfilter/ipt_ecn.c
+++ b/net/ipv4/netfilter/ipt_ecn.c
@@ -25,7 +25,8 @@ MODULE_LICENSE("GPL");
 static inline bool match_ip(const struct sk_buff *skb,
 			    const struct ipt_ecn_info *einfo)
 {
-	return (ip_hdr(skb)->tos & IPT_ECN_IP_MASK) == einfo->ip_ect;
+	return ((ip_hdr(skb)->tos & IPT_ECN_IP_MASK) == einfo->ip_ect) ^
+	       !!(einfo->invert & IPT_ECN_OP_MATCH_IP);
 }
 
 static inline bool match_tcp(const struct sk_buff *skb,
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] netfilter: xtables: add an IPv6 capable version of the ECN match
  2011-06-09 12:12 [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port kaber
  2011-06-09 12:12 ` [PATCH 1/3] netfilter: ipt_ecn: fix protocol check in ecn_mt_check() kaber
  2011-06-09 12:12 ` [PATCH 2/3] netfilter: ipt_ecn: fix inversion for IP header ECN match kaber
@ 2011-06-09 12:12 ` kaber
  2011-06-09 13:16 ` [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port Jan Engelhardt
  3 siblings, 0 replies; 7+ messages in thread
From: kaber @ 2011-06-09 12:12 UTC (permalink / raw)
  To: eric.dumazet, dave.taht; +Cc: netfilter-devel

From: Patrick McHardy <kaber@trash.net>

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 include/linux/netfilter/Kbuild   |    1 +
 include/linux/netfilter/xt_ecn.h |   33 +++++++
 net/ipv4/netfilter/Kconfig       |    9 --
 net/ipv4/netfilter/Makefile      |    1 -
 net/ipv4/netfilter/ipt_ecn.c     |  127 --------------------------
 net/netfilter/Kconfig            |    9 ++
 net/netfilter/Makefile           |    1 +
 net/netfilter/xt_ecn.c           |  187 ++++++++++++++++++++++++++++++++++++++
 8 files changed, 231 insertions(+), 137 deletions(-)
 create mode 100644 include/linux/netfilter/xt_ecn.h
 delete mode 100644 net/ipv4/netfilter/ipt_ecn.c
 create mode 100644 net/netfilter/xt_ecn.c

diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index a1b410c..e55dba1 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -40,6 +40,7 @@ header-y += xt_cpu.h
 header-y += xt_dccp.h
 header-y += xt_devgroup.h
 header-y += xt_dscp.h
+header-y += xt_ecn.h
 header-y += xt_esp.h
 header-y += xt_hashlimit.h
 header-y += xt_helper.h
diff --git a/include/linux/netfilter/xt_ecn.h b/include/linux/netfilter/xt_ecn.h
new file mode 100644
index 0000000..5a38dd3
--- /dev/null
+++ b/include/linux/netfilter/xt_ecn.h
@@ -0,0 +1,33 @@
+/* iptables module for matching the ECN header in IPv4 and TCP header
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ *
+ * This software is distributed under GNU GPL v2, 1991
+*/
+#ifndef _XT_ECN_H
+#define _XT_ECN_H
+
+#include <linux/types.h>
+#include <linux/netfilter/xt_dscp.h>
+
+#define XT_ECN_IP_MASK	(~XT_DSCP_MASK)
+
+#define XT_ECN_OP_MATCH_IP	0x01
+#define XT_ECN_OP_MATCH_ECE	0x10
+#define XT_ECN_OP_MATCH_CWR	0x20
+
+#define XT_ECN_OP_MATCH_MASK	0xce
+
+/* match info */
+struct xt_ecn_info {
+	__u8 operation;
+	__u8 invert;
+	__u8 ip_ect;
+	union {
+		struct {
+			__u8 ect;
+		} tcp;
+	} proto;
+};
+
+#endif /* _XT_ECN_H */
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
index 1dfc18a..9d1f82b 100644
--- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig
@@ -73,15 +73,6 @@ config IP_NF_MATCH_AH
 
 	  To compile it as a module, choose M here.  If unsure, say N.
 
-config IP_NF_MATCH_ECN
-	tristate '"ecn" match support'
-	depends on NETFILTER_ADVANCED
-	help
-	  This option adds a `ECN' match, which allows you to match against
-	  the IPv4 and TCP header ECN fields.
-
-	  To compile it as a module, choose M here.  If unsure, say N.
-
 config IP_NF_MATCH_TTL
 	tristate '"ttl" match support'
 	depends on NETFILTER_ADVANCED
diff --git a/net/ipv4/netfilter/Makefile b/net/ipv4/netfilter/Makefile
index dca2082..d16c7ec 100644
--- a/net/ipv4/netfilter/Makefile
+++ b/net/ipv4/netfilter/Makefile
@@ -49,7 +49,6 @@ obj-$(CONFIG_IP_NF_SECURITY) += iptable_security.o
 
 # matches
 obj-$(CONFIG_IP_NF_MATCH_AH) += ipt_ah.o
-obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o
 
 # targets
 obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o
diff --git a/net/ipv4/netfilter/ipt_ecn.c b/net/ipv4/netfilter/ipt_ecn.c
deleted file mode 100644
index 2b57e52..0000000
--- a/net/ipv4/netfilter/ipt_ecn.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* IP tables module for matching the value of the IPv4 and TCP ECN bits
- *
- * (C) 2002 by Harald Welte <laforge@gnumonks.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <linux/in.h>
-#include <linux/ip.h>
-#include <net/ip.h>
-#include <linux/module.h>
-#include <linux/skbuff.h>
-#include <linux/tcp.h>
-
-#include <linux/netfilter/x_tables.h>
-#include <linux/netfilter_ipv4/ip_tables.h>
-#include <linux/netfilter_ipv4/ipt_ecn.h>
-
-MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
-MODULE_DESCRIPTION("Xtables: Explicit Congestion Notification (ECN) flag match for IPv4");
-MODULE_LICENSE("GPL");
-
-static inline bool match_ip(const struct sk_buff *skb,
-			    const struct ipt_ecn_info *einfo)
-{
-	return ((ip_hdr(skb)->tos & IPT_ECN_IP_MASK) == einfo->ip_ect) ^
-	       !!(einfo->invert & IPT_ECN_OP_MATCH_IP);
-}
-
-static inline bool match_tcp(const struct sk_buff *skb,
-			     const struct ipt_ecn_info *einfo,
-			     bool *hotdrop)
-{
-	struct tcphdr _tcph;
-	const struct tcphdr *th;
-
-	/* In practice, TCP match does this, so can't fail.  But let's
-	 * be good citizens.
-	 */
-	th = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(_tcph), &_tcph);
-	if (th == NULL) {
-		*hotdrop = false;
-		return false;
-	}
-
-	if (einfo->operation & IPT_ECN_OP_MATCH_ECE) {
-		if (einfo->invert & IPT_ECN_OP_MATCH_ECE) {
-			if (th->ece == 1)
-				return false;
-		} else {
-			if (th->ece == 0)
-				return false;
-		}
-	}
-
-	if (einfo->operation & IPT_ECN_OP_MATCH_CWR) {
-		if (einfo->invert & IPT_ECN_OP_MATCH_CWR) {
-			if (th->cwr == 1)
-				return false;
-		} else {
-			if (th->cwr == 0)
-				return false;
-		}
-	}
-
-	return true;
-}
-
-static bool ecn_mt(const struct sk_buff *skb, struct xt_action_param *par)
-{
-	const struct ipt_ecn_info *info = par->matchinfo;
-
-	if (info->operation & IPT_ECN_OP_MATCH_IP)
-		if (!match_ip(skb, info))
-			return false;
-
-	if (info->operation & (IPT_ECN_OP_MATCH_ECE|IPT_ECN_OP_MATCH_CWR)) {
-		if (!match_tcp(skb, info, &par->hotdrop))
-			return false;
-	}
-
-	return true;
-}
-
-static int ecn_mt_check(const struct xt_mtchk_param *par)
-{
-	const struct ipt_ecn_info *info = par->matchinfo;
-	const struct ipt_ip *ip = par->entryinfo;
-
-	if (info->operation & IPT_ECN_OP_MATCH_MASK)
-		return -EINVAL;
-
-	if (info->invert & IPT_ECN_OP_MATCH_MASK)
-		return -EINVAL;
-
-	if (info->operation & (IPT_ECN_OP_MATCH_ECE|IPT_ECN_OP_MATCH_CWR) &&
-	    (ip->proto != IPPROTO_TCP || ip->invflags & IPT_INV_PROTO)) {
-		pr_info("cannot match TCP bits in rule for non-tcp packets\n");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-static struct xt_match ecn_mt_reg __read_mostly = {
-	.name		= "ecn",
-	.family		= NFPROTO_IPV4,
-	.match		= ecn_mt,
-	.matchsize	= sizeof(struct ipt_ecn_info),
-	.checkentry	= ecn_mt_check,
-	.me		= THIS_MODULE,
-};
-
-static int __init ecn_mt_init(void)
-{
-	return xt_register_match(&ecn_mt_reg);
-}
-
-static void __exit ecn_mt_exit(void)
-{
-	xt_unregister_match(&ecn_mt_reg);
-}
-
-module_init(ecn_mt_init);
-module_exit(ecn_mt_exit);
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index 32bff6d..69488dc 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -772,6 +772,15 @@ config NETFILTER_XT_MATCH_DSCP
 
 	  To compile it as a module, choose M here.  If unsure, say N.
 
+config NETFILTER_XT_MATCH_ECN
+	tristate '"ecn" match support'
+	depends on NETFILTER_ADVANCED
+	help
+	  This option adds a `ECN' match, which allows you to match against
+	  the IPv4/IPv6 and TCP header ECN fields.
+
+	  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_ADVANCED
diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile
index 1a02853..95c1f29 100644
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
@@ -78,6 +78,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_CONNLIMIT) += xt_connlimit.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_CONNTRACK) += xt_conntrack.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_CPU) += xt_cpu.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_DCCP) += xt_dccp.o
+obj-$(CONFIG_NETFILTER_XT_MATCH_ECN) += xt_ecn.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_DEVGROUP) += xt_devgroup.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_ESP) += xt_esp.o
diff --git a/net/netfilter/xt_ecn.c b/net/netfilter/xt_ecn.c
new file mode 100644
index 0000000..38f1a0d
--- /dev/null
+++ b/net/netfilter/xt_ecn.c
@@ -0,0 +1,187 @@
+/* xtables module for matching the value of the IPv4/IPv6 and TCP ECN bits
+ *
+ * (C) 2002 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2011 Patrick McHardy <kaber@trash.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/in.h>
+#include <linux/ip.h>
+#include <net/ip.h>
+#include <linux/module.h>
+#include <linux/skbuff.h>
+#include <linux/tcp.h>
+
+#include <linux/netfilter/x_tables.h>
+#include <linux/netfilter_ipv4/ip_tables.h>
+#include <linux/netfilter_ipv6/ip6_tables.h>
+#include <linux/netfilter/xt_ecn.h>
+
+MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
+MODULE_DESCRIPTION("Xtables: Explicit Congestion Notification (ECN) flag match");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("ipt_ecn");
+MODULE_ALIAS("ip6t_ecn");
+
+static bool match_tcp(const struct sk_buff *skb, struct xt_action_param *par)
+{
+	const struct xt_ecn_info *einfo = par->matchinfo;
+	struct tcphdr _tcph;
+	const struct tcphdr *th;
+
+	/* In practice, TCP match does this, so can't fail.  But let's
+	 * be good citizens.
+	 */
+	th = skb_header_pointer(skb, par->thoff, sizeof(_tcph), &_tcph);
+	if (th == NULL) {
+		return false;
+	}
+
+	if (einfo->operation & XT_ECN_OP_MATCH_ECE) {
+		if (einfo->invert & XT_ECN_OP_MATCH_ECE) {
+			if (th->ece == 1)
+				return false;
+		} else {
+			if (th->ece == 0)
+				return false;
+		}
+	}
+
+	if (einfo->operation & XT_ECN_OP_MATCH_CWR) {
+		if (einfo->invert & XT_ECN_OP_MATCH_CWR) {
+			if (th->cwr == 1)
+				return false;
+		} else {
+			if (th->cwr == 0)
+				return false;
+		}
+	}
+
+	return true;
+}
+
+static inline bool match_ip(const struct sk_buff *skb,
+			    const struct xt_ecn_info *einfo)
+{
+	return ((ip_hdr(skb)->tos & XT_ECN_IP_MASK) == einfo->ip_ect) ^
+	       !!(einfo->invert & XT_ECN_OP_MATCH_IP);
+}
+
+static bool ecn_mt4(const struct sk_buff *skb, struct xt_action_param *par)
+{
+	const struct xt_ecn_info *info = par->matchinfo;
+
+	if (info->operation & XT_ECN_OP_MATCH_IP)
+		if (!match_ip(skb, info))
+			return false;
+
+	if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR)) {
+		if (!match_tcp(skb, par))
+			return false;
+	}
+
+	return true;
+}
+
+static int ecn_mt_check4(const struct xt_mtchk_param *par)
+{
+	const struct xt_ecn_info *info = par->matchinfo;
+	const struct ipt_ip *ip = par->entryinfo;
+
+	if (info->operation & XT_ECN_OP_MATCH_MASK)
+		return -EINVAL;
+
+	if (info->invert & XT_ECN_OP_MATCH_MASK)
+		return -EINVAL;
+
+	if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR) &&
+	    (ip->proto != IPPROTO_TCP || ip->invflags & IPT_INV_PROTO)) {
+		pr_info("cannot match TCP bits in rule for non-tcp packets\n");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
+static inline bool match_ipv6(const struct sk_buff *skb,
+			      const struct xt_ecn_info *einfo)
+{
+	return (((ipv6_hdr(skb)->flow_lbl[0] >> 4) & XT_ECN_IP_MASK) ==
+	        einfo->ip_ect) ^
+	       !!(einfo->invert & XT_ECN_OP_MATCH_IP);
+}
+
+static bool ecn_mt6(const struct sk_buff *skb, struct xt_action_param *par)
+{
+	const struct xt_ecn_info *info = par->matchinfo;
+
+	if (info->operation & XT_ECN_OP_MATCH_IP)
+		if (!match_ipv6(skb, info))
+			return false;
+
+	if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR)) {
+		if (!match_tcp(skb, par))
+			return false;
+	}
+
+	return true;
+}
+
+static int ecn_mt_check6(const struct xt_mtchk_param *par)
+{
+	const struct xt_ecn_info *info = par->matchinfo;
+	const struct ip6t_ip6 *ip = par->entryinfo;
+
+	if (info->operation & XT_ECN_OP_MATCH_MASK)
+		return -EINVAL;
+
+	if (info->invert & XT_ECN_OP_MATCH_MASK)
+		return -EINVAL;
+
+	if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR) &&
+	    (ip->proto != IPPROTO_TCP || ip->invflags & IP6T_INV_PROTO)) {
+		pr_info("cannot match TCP bits in rule for non-tcp packets\n");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+#endif
+
+static struct xt_match ecn_mt_reg[] __read_mostly = {
+	{
+		.name		= "ecn",
+		.family		= NFPROTO_IPV4,
+		.match		= ecn_mt4,
+		.matchsize	= sizeof(struct xt_ecn_info),
+		.checkentry	= ecn_mt_check4,
+		.me		= THIS_MODULE,
+	},
+#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
+	{
+		.name		= "ecn",
+		.family		= NFPROTO_IPV6,
+		.match		= ecn_mt6,
+		.matchsize	= sizeof(struct xt_ecn_info),
+		.checkentry	= ecn_mt_check6,
+		.me		= THIS_MODULE,
+	},
+#endif
+};
+
+static int __init ecn_mt_init(void)
+{
+	return xt_register_matches(ecn_mt_reg, ARRAY_SIZE(ecn_mt_reg));
+}
+
+static void __exit ecn_mt_exit(void)
+{
+	xt_unregister_matches(ecn_mt_reg, ARRAY_SIZE(ecn_mt_reg));
+}
+
+module_init(ecn_mt_init);
+module_exit(ecn_mt_exit);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port
  2011-06-09 12:12 [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port kaber
                   ` (2 preceding siblings ...)
  2011-06-09 12:12 ` [PATCH 3/3] netfilter: xtables: add an IPv6 capable version of the " kaber
@ 2011-06-09 13:16 ` Jan Engelhardt
  2011-06-09 13:21   ` Patrick McHardy
  3 siblings, 1 reply; 7+ messages in thread
From: Jan Engelhardt @ 2011-06-09 13:16 UTC (permalink / raw)
  To: kaber; +Cc: eric.dumazet, dave.taht, netfilter-devel

On Thursday 2011-06-09 14:12, kaber@trash.net wrote:

>These patches contain two fixes for the ipt_ecn match and an IPv6 capable
>xtables port. Nothing particulary exciting in the patches, if noone spots
>any problems I'll push the first two patches to net-2.6 and the third one
>to net-next-2.6.
>
>iptables patch will follow shortly.
>
>Patrick McHardy (3):
>      netfilter: ipt_ecn: fix protocol check in ecn_mt_check()
>      netfilter: ipt_ecn: fix inversion for IP header ECN match
>      netfilter: xtables: add an IPv6 capable version of the ECN match

Do you have these in a git:// tree handy? I would like to see if the 
automatic move detection still kicks in (since it has a 50% threshold).
The raw non-move change could have been split otherwise.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port
  2011-06-09 13:16 ` [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port Jan Engelhardt
@ 2011-06-09 13:21   ` Patrick McHardy
  2011-06-09 20:19     ` Jan Engelhardt
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick McHardy @ 2011-06-09 13:21 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: eric.dumazet, dave.taht, netfilter-devel

On 09.06.2011 15:16, Jan Engelhardt wrote:
> On Thursday 2011-06-09 14:12, kaber@trash.net wrote:
> 
>> These patches contain two fixes for the ipt_ecn match and an IPv6 capable
>> xtables port. Nothing particulary exciting in the patches, if noone spots
>> any problems I'll push the first two patches to net-2.6 and the third one
>> to net-next-2.6.
>>
>> iptables patch will follow shortly.
>>
>> Patrick McHardy (3):
>>      netfilter: ipt_ecn: fix protocol check in ecn_mt_check()
>>      netfilter: ipt_ecn: fix inversion for IP header ECN match
>>      netfilter: xtables: add an IPv6 capable version of the ECN match
> 
> Do you have these in a git:// tree handy? I would like to see if the 
> automatic move detection still kicks in (since it has a 50% threshold).
> The raw non-move change could have been split otherwise.
> 

I pushed them out to

git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-testing.git

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port
  2011-06-09 13:21   ` Patrick McHardy
@ 2011-06-09 20:19     ` Jan Engelhardt
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Engelhardt @ 2011-06-09 20:19 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: eric.dumazet, dave.taht, netfilter-devel


On Thursday 2011-06-09 15:21, Patrick McHardy wrote:
>On 09.06.2011 15:16, Jan Engelhardt wrote:
>> On Thursday 2011-06-09 14:12, kaber@trash.net wrote:
>> 
>>> These patches contain two fixes for the ipt_ecn match and an IPv6 capable
>>> xtables port. Nothing particulary exciting in the patches, if noone spots
>>> any problems I'll push the first two patches to net-2.6 and the third one
>>> to net-next-2.6.
>>>
>>> iptables patch will follow shortly.
>>>
>>> Patrick McHardy (3):
>>>      netfilter: ipt_ecn: fix protocol check in ecn_mt_check()
>>>      netfilter: ipt_ecn: fix inversion for IP header ECN match
>>>      netfilter: xtables: add an IPv6 capable version of the ECN match
>> 
>> Do you have these in a git:// tree handy? I would like to see if the 
>> automatic move detection still kicks in (since it has a 50% threshold).
>> The raw non-move change could have been split otherwise.
>
>I pushed them out to
>git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-testing.git

I have an alternate patch approach based upon yours. send-email dump following.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-06-09 20:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-09 12:12 [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port kaber
2011-06-09 12:12 ` [PATCH 1/3] netfilter: ipt_ecn: fix protocol check in ecn_mt_check() kaber
2011-06-09 12:12 ` [PATCH 2/3] netfilter: ipt_ecn: fix inversion for IP header ECN match kaber
2011-06-09 12:12 ` [PATCH 3/3] netfilter: xtables: add an IPv6 capable version of the " kaber
2011-06-09 13:16 ` [PATCH 0/3] netfilter: ecn match fixes and IPv6 capable xtables port Jan Engelhardt
2011-06-09 13:21   ` Patrick McHardy
2011-06-09 20:19     ` Jan Engelhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.