aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-01-21 03:13:44 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:08:22 -0500
commit13893567358a8426d03ac3c613befc55431f23ce (patch)
tree181d16d62a21022cbe93d2993d006066c0d4bffb /net/sched
parent645a1e39e4e3e84a275c5e4a7c8049041146f9b5 (diff)
[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: Patrick McHardy <kaber@trash.net> Acked-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_ingress.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index b30ca01bdc04..4c7f7e712918 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -20,11 +20,9 @@
20 20
21 21
22/* Thanks to Doron Oz for this hack */ 22/* Thanks to Doron Oz for this hack */
23#ifndef CONFIG_NET_CLS_ACT 23#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
24#ifdef CONFIG_NETFILTER
25static int nf_registered; 24static int nf_registered;
26#endif 25#endif
27#endif
28 26
29struct ingress_qdisc_data { 27struct ingress_qdisc_data {
30 struct tcf_proto *filter_list; 28 struct tcf_proto *filter_list;
@@ -118,8 +116,7 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
118 return result; 116 return result;
119} 117}
120 118
121#ifndef CONFIG_NET_CLS_ACT 119#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
122#ifdef CONFIG_NETFILTER
123static unsigned int ing_hook(unsigned int hook, struct sk_buff *skb, 120static unsigned int ing_hook(unsigned int hook, struct sk_buff *skb,
124 const struct net_device *indev, 121 const struct net_device *indev,
125 const struct net_device *outdev, 122 const struct net_device *outdev,
@@ -158,12 +155,10 @@ static struct nf_hook_ops ing_ops[] __read_mostly = {
158 }, 155 },
159}; 156};
160#endif 157#endif
161#endif
162 158
163static int ingress_init(struct Qdisc *sch, struct rtattr *opt) 159static int ingress_init(struct Qdisc *sch, struct rtattr *opt)
164{ 160{
165#ifndef CONFIG_NET_CLS_ACT 161#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
166#ifdef CONFIG_NETFILTER
167 printk("Ingress scheduler: Classifier actions prefered over netfilter\n"); 162 printk("Ingress scheduler: Classifier actions prefered over netfilter\n");
168 163
169 if (!nf_registered) { 164 if (!nf_registered) {
@@ -174,7 +169,6 @@ static int ingress_init(struct Qdisc *sch, struct rtattr *opt)
174 nf_registered++; 169 nf_registered++;
175 } 170 }
176#endif 171#endif
177#endif
178 return 0; 172 return 0;
179} 173}
180 174
@@ -240,12 +234,10 @@ static int __init ingress_module_init(void)
240static void __exit ingress_module_exit(void) 234static void __exit ingress_module_exit(void)
241{ 235{
242 unregister_qdisc(&ingress_qdisc_ops); 236 unregister_qdisc(&ingress_qdisc_ops);
243#ifndef CONFIG_NET_CLS_ACT 237#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
244#ifdef CONFIG_NETFILTER
245 if (nf_registered) 238 if (nf_registered)
246 nf_unregister_hooks(ing_ops, ARRAY_SIZE(ing_ops)); 239 nf_unregister_hooks(ing_ops, ARRAY_SIZE(ing_ops));
247#endif 240#endif
248#endif
249} 241}
250 242
251module_init(ingress_module_init) 243module_init(ingress_module_init)