aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet
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/decnet
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/decnet')
-rw-r--r--net/decnet/dn_rules.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index 84ff3dd37070..ddd3f04f0919 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -57,8 +57,6 @@ static struct dn_fib_rule default_rule = {
57 }, 57 },
58}; 58};
59 59
60static LIST_HEAD(dn_fib_rules);
61
62 60
63int dn_fib_lookup(struct flowi *flp, struct dn_fib_res *res) 61int dn_fib_lookup(struct flowi *flp, struct dn_fib_res *res)
64{ 62{
@@ -228,9 +226,9 @@ static u32 dn_fib_rule_default_pref(void)
228 struct list_head *pos; 226 struct list_head *pos;
229 struct fib_rule *rule; 227 struct fib_rule *rule;
230 228
231 if (!list_empty(&dn_fib_rules)) { 229 if (!list_empty(&dn_fib_rules_ops.rules_list)) {
232 pos = dn_fib_rules.next; 230 pos = dn_fib_rules_ops.rules_list.next;
233 if (pos->next != &dn_fib_rules) { 231 if (pos->next != &dn_fib_rules_ops.rules_list) {
234 rule = list_entry(pos->next, struct fib_rule, list); 232 rule = list_entry(pos->next, struct fib_rule, list);
235 if (rule->pref) 233 if (rule->pref)
236 return rule->pref - 1; 234 return rule->pref - 1;
@@ -258,13 +256,14 @@ static struct fib_rules_ops dn_fib_rules_ops = {
258 .flush_cache = dn_fib_rule_flush_cache, 256 .flush_cache = dn_fib_rule_flush_cache,
259 .nlgroup = RTNLGRP_DECnet_RULE, 257 .nlgroup = RTNLGRP_DECnet_RULE,
260 .policy = dn_fib_rule_policy, 258 .policy = dn_fib_rule_policy,
261 .rules_list = &dn_fib_rules, 259 .rules_list = LIST_HEAD_INIT(dn_fib_rules_ops.rules_list),
262 .owner = THIS_MODULE, 260 .owner = THIS_MODULE,
263}; 261};
264 262
265void __init dn_fib_rules_init(void) 263void __init dn_fib_rules_init(void)
266{ 264{
267 list_add_tail(&default_rule.common.list, &dn_fib_rules); 265 list_add_tail(&default_rule.common.list,
266 &dn_fib_rules_ops.rules_list);
268 fib_rules_register(&dn_fib_rules_ops); 267 fib_rules_register(&dn_fib_rules_ops);
269} 268}
270 269