aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_rules.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2007-09-16 18:44:27 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:22 -0400
commit76c72d4f44ec5fb7f88eda8a0d3aa30922c891d1 (patch)
tree0c773487ff11d098a70fddbc631f153260614bdb /net/ipv4/fib_rules.c
parent056925ab3145713e5e83cf8e05ae6fb2f4ace41e (diff)
[IPV4/IPV6/DECNET]: Small cleanup for fib rules.
This patch slightly cleanups FIB rules framework. rules_list as a pointer on struct fib_rules_ops is useless. It is always assigned with a static per/subsystem list in IPv4, IPv6 and DecNet. Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_rules.c')
-rw-r--r--net/ipv4/fib_rules.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index 2a947840210e..f16839c6a721 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -76,8 +76,6 @@ static struct fib4_rule local_rule = {
76 }, 76 },
77}; 77};
78 78
79static LIST_HEAD(fib4_rules);
80
81#ifdef CONFIG_NET_CLS_ROUTE 79#ifdef CONFIG_NET_CLS_ROUTE
82u32 fib_rules_tclass(struct fib_result *res) 80u32 fib_rules_tclass(struct fib_result *res)
83{ 81{
@@ -279,9 +277,9 @@ static u32 fib4_rule_default_pref(void)
279 struct list_head *pos; 277 struct list_head *pos;
280 struct fib_rule *rule; 278 struct fib_rule *rule;
281 279
282 if (!list_empty(&fib4_rules)) { 280 if (!list_empty(&fib4_rules_ops.rules_list)) {
283 pos = fib4_rules.next; 281 pos = fib4_rules_ops.rules_list.next;
284 if (pos->next != &fib4_rules) { 282 if (pos->next != &fib4_rules_ops.rules_list) {
285 rule = list_entry(pos->next, struct fib_rule, list); 283 rule = list_entry(pos->next, struct fib_rule, list);
286 if (rule->pref) 284 if (rule->pref)
287 return rule->pref - 1; 285 return rule->pref - 1;
@@ -317,15 +315,15 @@ static struct fib_rules_ops fib4_rules_ops = {
317 .flush_cache = fib4_rule_flush_cache, 315 .flush_cache = fib4_rule_flush_cache,
318 .nlgroup = RTNLGRP_IPV4_RULE, 316 .nlgroup = RTNLGRP_IPV4_RULE,
319 .policy = fib4_rule_policy, 317 .policy = fib4_rule_policy,
320 .rules_list = &fib4_rules, 318 .rules_list = LIST_HEAD_INIT(fib4_rules_ops.rules_list),
321 .owner = THIS_MODULE, 319 .owner = THIS_MODULE,
322}; 320};
323 321
324void __init fib4_rules_init(void) 322void __init fib4_rules_init(void)
325{ 323{
326 list_add_tail(&local_rule.common.list, &fib4_rules); 324 list_add_tail(&local_rule.common.list, &fib4_rules_ops.rules_list);
327 list_add_tail(&main_rule.common.list, &fib4_rules); 325 list_add_tail(&main_rule.common.list, &fib4_rules_ops.rules_list);
328 list_add_tail(&default_rule.common.list, &fib4_rules); 326 list_add_tail(&default_rule.common.list, &fib4_rules_ops.rules_list);
329 327
330 fib_rules_register(&fib4_rules_ops); 328 fib_rules_register(&fib4_rules_ops);
331} 329}