]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/fib_rules.c
net: add fib_rules_ops to flush_cache method
[net-next-2.6.git] / net / ipv4 / fib_rules.c
index 1effb4ab688ce4568f87f0ae28583b8c3f99faf8..6080d712082160b649cea3675901072be287f705 100644 (file)
@@ -102,16 +102,6 @@ errout:
 }
 
 
-void fib_select_default(const struct flowi *flp, struct fib_result *res)
-{
-       if (res->r && res->r->action == FR_ACT_TO_TBL &&
-           FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) {
-               struct fib_table *tb;
-               if ((tb = fib_get_table(&init_net, res->r->table)) != NULL)
-                       tb->tb_select_default(tb, flp, res);
-       }
-}
-
 static int fib4_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
 {
        struct fib4_rule *r = (struct fib4_rule *) rule;
@@ -147,7 +137,7 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
                               struct nlmsghdr *nlh, struct fib_rule_hdr *frh,
                               struct nlattr **tb)
 {
-       struct net *net = skb->sk->sk_net;
+       struct net *net = sock_net(skb->sk);
        int err = -EINVAL;
        struct fib4_rule *rule4 = (struct fib4_rule *) rule;
 
@@ -268,9 +258,9 @@ static size_t fib4_rule_nlmsg_payload(struct fib_rule *rule)
               + nla_total_size(4); /* flow */
 }
 
-static void fib4_rule_flush_cache(void)
+static void fib4_rule_flush_cache(struct fib_rules_ops *ops)
 {
-       rt_cache_flush(-1);
+       rt_cache_flush(ops->fro_net, -1);
 }
 
 static struct fib_rules_ops fib4_rules_ops_template = {