Commit 13893567 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NET_SCHED]: sch_ingress: avoid a few #ifdefs

Move the repeating "ifndef CONFIG_NET_CLS_ACT/ifdef CONFIG_NETFILTER"
ifdefs into a single condition.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Acked-by: default avatarJamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 645a1e39
...@@ -20,11 +20,9 @@ ...@@ -20,11 +20,9 @@
/* Thanks to Doron Oz for this hack */ /* Thanks to Doron Oz for this hack */
#ifndef CONFIG_NET_CLS_ACT #if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
#ifdef CONFIG_NETFILTER
static int nf_registered; static int nf_registered;
#endif #endif
#endif
struct ingress_qdisc_data { struct ingress_qdisc_data {
struct tcf_proto *filter_list; struct tcf_proto *filter_list;
...@@ -118,8 +116,7 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch) ...@@ -118,8 +116,7 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
return result; return result;
} }
#ifndef CONFIG_NET_CLS_ACT #if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
#ifdef CONFIG_NETFILTER
static unsigned int ing_hook(unsigned int hook, struct sk_buff *skb, static unsigned int ing_hook(unsigned int hook, struct sk_buff *skb,
const struct net_device *indev, const struct net_device *indev,
const struct net_device *outdev, const struct net_device *outdev,
...@@ -158,12 +155,10 @@ static struct nf_hook_ops ing_ops[] __read_mostly = { ...@@ -158,12 +155,10 @@ static struct nf_hook_ops ing_ops[] __read_mostly = {
}, },
}; };
#endif #endif
#endif
static int ingress_init(struct Qdisc *sch, struct rtattr *opt) static int ingress_init(struct Qdisc *sch, struct rtattr *opt)
{ {
#ifndef CONFIG_NET_CLS_ACT #if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
#ifdef CONFIG_NETFILTER
printk("Ingress scheduler: Classifier actions prefered over netfilter\n"); printk("Ingress scheduler: Classifier actions prefered over netfilter\n");
if (!nf_registered) { if (!nf_registered) {
...@@ -173,7 +168,6 @@ static int ingress_init(struct Qdisc *sch, struct rtattr *opt) ...@@ -173,7 +168,6 @@ static int ingress_init(struct Qdisc *sch, struct rtattr *opt)
} }
nf_registered++; nf_registered++;
} }
#endif
#endif #endif
return 0; return 0;
} }
...@@ -240,12 +234,10 @@ static int __init ingress_module_init(void) ...@@ -240,12 +234,10 @@ static int __init ingress_module_init(void)
static void __exit ingress_module_exit(void) static void __exit ingress_module_exit(void)
{ {
unregister_qdisc(&ingress_qdisc_ops); unregister_qdisc(&ingress_qdisc_ops);
#ifndef CONFIG_NET_CLS_ACT #if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
#ifdef CONFIG_NETFILTER
if (nf_registered) if (nf_registered)
nf_unregister_hooks(ing_ops, ARRAY_SIZE(ing_ops)); nf_unregister_hooks(ing_ops, ARRAY_SIZE(ing_ops));
#endif #endif
#endif
} }
module_init(ingress_module_init) module_init(ingress_module_init)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment