net 04/05: fib_rules: allow to delete local rule
[safe/jmp/linux-2.6] / net / ipv6 / fib6_rules.c
index e7a7fe2..3b38f49 100644 (file)
@@ -93,7 +93,8 @@ static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
                        if (flags & RT6_LOOKUP_F_SRCPREF_COA)
                                srcprefs |= IPV6_PREFER_SRC_COA;
 
-                       if (ipv6_dev_get_saddr(ip6_dst_idev(&rt->u.dst)->dev,
+                       if (ipv6_dev_get_saddr(net,
+                                              ip6_dst_idev(&rt->u.dst)->dev,
                                               &flp->fl6_dst, srcprefs,
                                               &saddr))
                                goto again;
@@ -150,11 +151,11 @@ static const struct nla_policy fib6_rule_policy[FRA_MAX+1] = {
 };
 
 static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
-                              struct nlmsghdr *nlh, struct fib_rule_hdr *frh,
+                              struct fib_rule_hdr *frh,
                               struct nlattr **tb)
 {
        int err = -EINVAL;
-       struct net *net = skb->sk->sk_net;
+       struct net *net = sock_net(skb->sk);
        struct fib6_rule *rule6 = (struct fib6_rule *) rule;
 
        if (rule->action == FR_ACT_TO_TBL) {
@@ -210,7 +211,7 @@ static int fib6_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
 }
 
 static int fib6_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
-                         struct nlmsghdr *nlh, struct fib_rule_hdr *frh)
+                         struct fib_rule_hdr *frh)
 {
        struct fib6_rule *rule6 = (struct fib6_rule *) rule;
 
@@ -275,7 +276,7 @@ static int fib6_rules_net_init(struct net *net)
        INIT_LIST_HEAD(&net->ipv6.fib6_rules_ops->rules_list);
 
        err = fib_default_rule_add(net->ipv6.fib6_rules_ops, 0,
-                                  RT6_TABLE_LOCAL, FIB_RULE_PERMANENT);
+                                  RT6_TABLE_LOCAL, 0);
        if (err)
                goto out_fib6_rules_ops;
 
@@ -316,5 +317,5 @@ int __init fib6_rules_init(void)
 
 void fib6_rules_cleanup(void)
 {
-       return unregister_pernet_subsys(&fib6_rules_net_ops);
+       unregister_pernet_subsys(&fib6_rules_net_ops);
 }