[NETNS]: Pass fib_rules_ops into default_pref method.
authorDenis V. Lunev <den@openvz.org>
Thu, 10 Jan 2008 11:18:25 +0000 (03:18 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:01:22 +0000 (15:01 -0800)
fib_rules_ops contains operations and the list of configured rules. ops will
become per/namespace soon, so we need them to be known in the default_pref
callback.

Acked-by: Benjamin Thery <benjamin.thery@bull.net>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/fib_rules.h
net/core/fib_rules.c
net/decnet/dn_rules.c
net/ipv4/fib_rules.c
net/ipv6/fib6_rules.c

index f7351b0..e9a074c 100644 (file)
@@ -56,7 +56,7 @@ struct fib_rules_ops
        int                     (*fill)(struct fib_rule *, struct sk_buff *,
                                        struct nlmsghdr *,
                                        struct fib_rule_hdr *);
-       u32                     (*default_pref)(void);
+       u32                     (*default_pref)(struct fib_rules_ops *ops);
        size_t                  (*nlmsg_payload)(struct fib_rule *);
 
        /* Called after modifications to the rules set, must flush
index ada9c81..e12e9f5 100644 (file)
@@ -285,7 +285,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
        rule->table = frh_get_table(frh, tb);
 
        if (!rule->pref && ops->default_pref)
-               rule->pref = ops->default_pref();
+               rule->pref = ops->default_pref(ops);
 
        err = -EINVAL;
        if (tb[FRA_GOTO]) {
index 0b5e2b9..c1fae23 100644 (file)
@@ -212,7 +212,7 @@ nla_put_failure:
        return -ENOBUFS;
 }
 
-static u32 dn_fib_rule_default_pref(void)
+static u32 dn_fib_rule_default_pref(struct fib_rules_ops *ops)
 {
        struct list_head *pos;
        struct fib_rule *rule;
index eac3f71..afe669d 100644 (file)
@@ -245,7 +245,7 @@ nla_put_failure:
        return -ENOBUFS;
 }
 
-static u32 fib4_rule_default_pref(void)
+static u32 fib4_rule_default_pref(struct fib_rules_ops *ops)
 {
        struct list_head *pos;
        struct fib_rule *rule;
index e4d7e5a..76437a1 100644 (file)
@@ -223,7 +223,7 @@ nla_put_failure:
        return -ENOBUFS;
 }
 
-static u32 fib6_rule_default_pref(void)
+static u32 fib6_rule_default_pref(struct fib_rules_ops *ops)
 {
        return 0x3FFF;
 }