netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets when using netfilter hooks
@ 2005-01-31 18:48 Thomas Graf
  2005-02-02 21:07 ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Graf @ 2005-01-31 18:48 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

Jamal, close your eyes please.

Fixes the ingress qdisc to pick up IPv6 packets when using the old
style netfilter hooks, i.e. when CONFIG_NET_CLS_ACT is not enabled.

Signed-off-by: Thomas Graf <tgraf@suug.ch>

--- linux-2.6.11-rc2-bk8.orig/net/sched/sch_ingress.c	2005-01-30 21:19:51.000000000 +0100
+++ linux-2.6.11-rc2-bk8/net/sched/sch_ingress.c	2005-01-31 19:32:29.000000000 +0100
@@ -14,6 +14,7 @@
 #include <linux/netdevice.h>
 #include <linux/rtnetlink.h>
 #include <linux/netfilter_ipv4.h>
+#include <linux/netfilter_ipv6.h>
 #include <linux/netfilter.h>
 #include <linux/smp.h>
 #include <net/pkt_sched.h>
@@ -271,6 +272,14 @@
 	.priority       = NF_IP_PRI_FILTER + 1,
 };
 
+static struct nf_hook_ops ing6_ops = {
+	.hook           = ing_hook,
+	.owner		= THIS_MODULE,
+	.pf             = PF_INET6,
+	.hooknum        = NF_IP6_PRE_ROUTING,
+	.priority       = NF_IP6_PRI_FILTER + 1,
+};
+
 #endif
 #endif
 
@@ -297,6 +306,12 @@
 			return -EINVAL;
 		}
 		nf_registered++;
+
+		if (nf_register_hook(&ing6_ops) < 0) {
+			printk("IPv6 ingress qdisc registration error, " \
+			    "disabling IPv6 support.\n");
+		} else
+			nf_registered++;
 	}
 #endif
 #endif
@@ -408,8 +423,11 @@
 	unregister_qdisc(&ingress_qdisc_ops);
 #ifndef CONFIG_NET_CLS_ACT
 #ifdef CONFIG_NETFILTER
-	if (nf_registered)
+	if (nf_registered) {
 		nf_unregister_hook(&ing_ops);
+		if (nf_registered > 1)
+			nf_unregister_hook(&ing6_ops);
+	}
 #endif
 #endif
 }

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

* Re: [PATCH] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets when using netfilter hooks
  2005-01-31 18:48 [PATCH] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets when using netfilter hooks Thomas Graf
@ 2005-02-02 21:07 ` David S. Miller
  2005-02-02 22:36   ` [PATCH 2.4] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets Thomas Graf
  0 siblings, 1 reply; 4+ messages in thread
From: David S. Miller @ 2005-02-02 21:07 UTC (permalink / raw)
  To: Thomas Graf; +Cc: netdev

On Mon, 31 Jan 2005 19:48:27 +0100
Thomas Graf <tgraf@suug.ch> wrote:

> Jamal, close your eyes please.

:-)
 
> Fixes the ingress qdisc to pick up IPv6 packets when using the old
> style netfilter hooks, i.e. when CONFIG_NET_CLS_ACT is not enabled.
> 
> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Applied, thanks Thomas.

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

* Re: [PATCH 2.4] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets
  2005-02-02 22:36   ` [PATCH 2.4] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets Thomas Graf
@ 2005-02-02 22:30     ` David S. Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2005-02-02 22:30 UTC (permalink / raw)
  To: Thomas Graf; +Cc: netdev

On Wed, 2 Feb 2005 23:36:29 +0100
Thomas Graf <tgraf@suug.ch> wrote:

> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Applied, thanks Thomas.

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

* [PATCH 2.4] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets
  2005-02-02 21:07 ` David S. Miller
@ 2005-02-02 22:36   ` Thomas Graf
  2005-02-02 22:30     ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Graf @ 2005-02-02 22:36 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

Signed-off-by: Thomas Graf <tgraf@suug.ch>

--- linux-2.4.29-bk8.orig/net/sched/sch_ingress.c	2005-02-02 22:32:51.000000000 +0100
+++ linux-2.4.29-bk8/net/sched/sch_ingress.c	2005-02-02 22:56:33.000000000 +0100
@@ -14,6 +14,7 @@
 #include <linux/netdevice.h>
 #include <linux/rtnetlink.h>
 #include <linux/netfilter_ipv4.h>
+#include <linux/netfilter_ipv6.h>
 #include <linux/netfilter.h>
 #include <linux/smp.h>
 #include <net/pkt_sched.h>
@@ -241,6 +242,15 @@
 	NF_IP_PRI_FILTER + 1
 };
 
+static struct nf_hook_ops ing6_ops =
+{
+	{ NULL, NULL},
+	ing_hook,
+	PF_INET6,
+	NF_IP6_PRE_ROUTING,
+	NF_IP6_PRI_FILTER + 1
+};
+
 int ingress_init(struct Qdisc *sch,struct rtattr *opt)
 {
 	struct ingress_qdisc_data *p = PRIV(sch);
@@ -249,8 +259,13 @@
 		if (nf_register_hook(&ing_ops) < 0) {
 			printk("ingress qdisc registration error \n");
 			goto error;
-			}
+		}
 		nf_registered++;
+		if (nf_register_hook(&ing6_ops) < 0) {
+			printk("IPv6 ingress qdisc registration error, " \
+			    "disabling IPv6 support.\n");
+		} else
+			nf_registered++;
 	}
 
 	DPRINTK("ingress_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt);
@@ -374,8 +389,11 @@
 void cleanup_module(void) 
 {
 	unregister_qdisc(&ingress_qdisc_ops);
-	if (nf_registered)
+	if (nf_registered) {
 		nf_unregister_hook(&ing_ops);
+		if (nf_registered > 1)
+			nf_unregister_hook(&ing6_ops);
+	}
 }
 #endif
 MODULE_LICENSE("GPL");

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

end of thread, other threads:[~2005-02-02 22:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-31 18:48 [PATCH] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets when using netfilter hooks Thomas Graf
2005-02-02 21:07 ` David S. Miller
2005-02-02 22:36   ` [PATCH 2.4] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets Thomas Graf
2005-02-02 22:30     ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).