]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/decnet/dn_rules.c
net: fib_rules: decouple address families from real address families
[net-next-2.6.git] / net / decnet / dn_rules.c
index 7466c546f2860d85ad51fc5b821f6775aa1d9012..af28dcc2184494b5528c8ad0cade76e1f450219f 100644 (file)
@@ -196,7 +196,6 @@ static int dn_fib_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
 {
        struct dn_fib_rule *r = (struct dn_fib_rule *)rule;
 
-       frh->family = AF_DECnet;
        frh->dst_len = r->dst_len;
        frh->src_len = r->src_len;
        frh->tos = 0;
@@ -212,30 +211,13 @@ nla_put_failure:
        return -ENOBUFS;
 }
 
-static u32 dn_fib_rule_default_pref(struct fib_rules_ops *ops)
-{
-       struct list_head *pos;
-       struct fib_rule *rule;
-
-       if (!list_empty(&dn_fib_rules_ops->rules_list)) {
-               pos = dn_fib_rules_ops->rules_list.next;
-               if (pos->next != &dn_fib_rules_ops->rules_list) {
-                       rule = list_entry(pos->next, struct fib_rule, list);
-                       if (rule->pref)
-                               return rule->pref - 1;
-               }
-       }
-
-       return 0;
-}
-
 static void dn_fib_rule_flush_cache(struct fib_rules_ops *ops)
 {
        dn_rt_cache_flush(-1);
 }
 
 static struct fib_rules_ops dn_fib_rules_ops_template = {
-       .family         = AF_DECnet,
+       .family         = FIB_RULES_DECNET,
        .rule_size      = sizeof(struct dn_fib_rule),
        .addr_size      = sizeof(u16),
        .action         = dn_fib_rule_action,
@@ -243,7 +225,7 @@ static struct fib_rules_ops dn_fib_rules_ops_template = {
        .configure      = dn_fib_rule_configure,
        .compare        = dn_fib_rule_compare,
        .fill           = dn_fib_rule_fill,
-       .default_pref   = dn_fib_rule_default_pref,
+       .default_pref   = fib_default_rule_pref,
        .flush_cache    = dn_fib_rule_flush_cache,
        .nlgroup        = RTNLGRP_DECnet_RULE,
        .policy         = dn_fib_rule_policy,