Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 10:48:14 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VIm7Xf016701 for ; Mon, 31 Jan 2005 10:48:07 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 7D5BC82; Mon, 31 Jan 2005 19:47:44 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 540EA1C0EA; Mon, 31 Jan 2005 19:48:27 +0100 (CET) Date: Mon, 31 Jan 2005 19:48:27 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets when using netfilter hooks Message-ID: <20050131184827.GH31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1111 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1447 Lines: 58 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 --- 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 #include #include +#include #include #include #include @@ -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 }