[NET_SCHED]: sch_ingress: move dependencies to Kconfig
authorPatrick McHardy <kaber@trash.net>
Mon, 21 Jan 2008 08:13:19 +0000 (00:13 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:08:21 +0000 (15:08 -0800)
Instead of complaining at scheduler initialization time, check the
dependencies in Kconfig.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/Kconfig
net/sched/sch_ingress.c

index f5ab54b1edd39bb888dbf24dff79164e19c17e97..554248e0fc4c1f2ef68296f228c5ba6cb2a81454 100644 (file)
@@ -198,6 +198,7 @@ config NET_SCH_NETEM
 
 config NET_SCH_INGRESS
        tristate "Ingress Qdisc"
+       depends on NET_CLS_ACT || NETFILTER
        ---help---
          Say Y here if you want to use classifiers for incoming packets.
          If unsure, say Y.
index c69e7bc7fb6c4d948ac0cfcdff1f5fd271bec704..b30ca01bdc047bb6fd89ab8b1e7022c3449eaf91 100644 (file)
@@ -162,19 +162,10 @@ static struct nf_hook_ops ing_ops[] __read_mostly = {
 
 static int ingress_init(struct Qdisc *sch, struct rtattr *opt)
 {
-       /* Make sure either netfilter or preferably CLS_ACT is
-        * compiled in */
 #ifndef CONFIG_NET_CLS_ACT
-#ifndef CONFIG_NETFILTER
-       printk("You MUST compile classifier actions into the kernel\n");
-       return -EINVAL;
-#else
+#ifdef CONFIG_NETFILTER
        printk("Ingress scheduler: Classifier actions prefered over netfilter\n");
-#endif
-#endif
 
-#ifndef CONFIG_NET_CLS_ACT
-#ifdef CONFIG_NETFILTER
        if (!nf_registered) {
                if (nf_register_hooks(ing_ops, ARRAY_SIZE(ing_ops)) < 0) {
                        printk("ingress qdisc registration error \n");