aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2010-04-13 01:03:15 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-13 17:49:30 -0400
commitd8a566beaa75c6ad5e38cdccf0ea5294323e7866 (patch)
tree56fc11f0806e9e869e65c44a697c896add4b78f6 /net/decnet
parent561155110307ad304226a23272244398fa46cbae (diff)
net: fib_rules: consolidate IPv4 and DECnet ->default_pref() functions.
Both functions are equivalent, consolidate them since a following patch needs a third implementation for multicast routing. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/dn_rules.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index 7466c546f286..2d14093a2c3a 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -212,23 +212,6 @@ nla_put_failure:
212 return -ENOBUFS; 212 return -ENOBUFS;
213} 213}
214 214
215static u32 dn_fib_rule_default_pref(struct fib_rules_ops *ops)
216{
217 struct list_head *pos;
218 struct fib_rule *rule;
219
220 if (!list_empty(&dn_fib_rules_ops->rules_list)) {
221 pos = dn_fib_rules_ops->rules_list.next;
222 if (pos->next != &dn_fib_rules_ops->rules_list) {
223 rule = list_entry(pos->next, struct fib_rule, list);
224 if (rule->pref)
225 return rule->pref - 1;
226 }
227 }
228
229 return 0;
230}
231
232static void dn_fib_rule_flush_cache(struct fib_rules_ops *ops) 215static void dn_fib_rule_flush_cache(struct fib_rules_ops *ops)
233{ 216{
234 dn_rt_cache_flush(-1); 217 dn_rt_cache_flush(-1);
@@ -243,7 +226,7 @@ static struct fib_rules_ops dn_fib_rules_ops_template = {
243 .configure = dn_fib_rule_configure, 226 .configure = dn_fib_rule_configure,
244 .compare = dn_fib_rule_compare, 227 .compare = dn_fib_rule_compare,
245 .fill = dn_fib_rule_fill, 228 .fill = dn_fib_rule_fill,
246 .default_pref = dn_fib_rule_default_pref, 229 .default_pref = fib_default_rule_pref,
247 .flush_cache = dn_fib_rule_flush_cache, 230 .flush_cache = dn_fib_rule_flush_cache,
248 .nlgroup = RTNLGRP_DECnet_RULE, 231 .nlgroup = RTNLGRP_DECnet_RULE,
249 .policy = dn_fib_rule_policy, 232 .policy = dn_fib_rule_policy,