diff options
-rw-r--r-- | include/net/fib_rules.h | 1 | ||||
-rw-r--r-- | net/core/fib_rules.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_rules.c | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 7f9f4aec8fc8..34349f9f4331 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -22,6 +22,7 @@ struct fib_rule | |||
22 | u32 target; | 22 | u32 target; |
23 | struct fib_rule * ctarget; | 23 | struct fib_rule * ctarget; |
24 | struct rcu_head rcu; | 24 | struct rcu_head rcu; |
25 | struct net * fr_net; | ||
25 | }; | 26 | }; |
26 | 27 | ||
27 | struct fib_lookup_arg | 28 | struct fib_lookup_arg |
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 3cd4f13413f6..42ccaf5b8509 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
@@ -29,6 +29,7 @@ int fib_default_rule_add(struct fib_rules_ops *ops, | |||
29 | r->pref = pref; | 29 | r->pref = pref; |
30 | r->table = table; | 30 | r->table = table; |
31 | r->flags = flags; | 31 | r->flags = flags; |
32 | r->fr_net = ops->fro_net; | ||
32 | 33 | ||
33 | /* The lock is not required here, the list in unreacheable | 34 | /* The lock is not required here, the list in unreacheable |
34 | * at the moment this function is called */ | 35 | * at the moment this function is called */ |
@@ -242,6 +243,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | |||
242 | err = -ENOMEM; | 243 | err = -ENOMEM; |
243 | goto errout; | 244 | goto errout; |
244 | } | 245 | } |
246 | rule->fr_net = net; | ||
245 | 247 | ||
246 | if (tb[FRA_PRIORITY]) | 248 | if (tb[FRA_PRIORITY]) |
247 | rule->pref = nla_get_u32(tb[FRA_PRIORITY]); | 249 | rule->pref = nla_get_u32(tb[FRA_PRIORITY]); |
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index 3b7affd5cb3b..d2001f1c28a2 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
@@ -91,7 +91,7 @@ static int fib4_rule_action(struct fib_rule *rule, struct flowi *flp, | |||
91 | goto errout; | 91 | goto errout; |
92 | } | 92 | } |
93 | 93 | ||
94 | if ((tbl = fib_get_table(&init_net, rule->table)) == NULL) | 94 | if ((tbl = fib_get_table(rule->fr_net, rule->table)) == NULL) |
95 | goto errout; | 95 | goto errout; |
96 | 96 | ||
97 | err = tbl->tb_lookup(tbl, flp, (struct fib_result *) arg->result); | 97 | err = tbl->tb_lookup(tbl, flp, (struct fib_result *) arg->result); |