[patch 20/38][IPV6] fib6_rules - make fib_rules per network namespace

Daniel Lezcano dlezcano at fr.ibm.com
Mon Dec 3 08:16:56 PST 2007


This patch makes the fib6_rules per network namespace.

Signed-off-by: Daniel Lezcano <dlezcano at fr.ibm.com>
Signed-off-by: Benjamin Thery <benjamin.thery at bull.net>
---
 net/ipv6/fib6_rules.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6-netns/net/ipv6/fib6_rules.c
===================================================================
--- linux-2.6-netns.orig/net/ipv6/fib6_rules.c
+++ linux-2.6-netns/net/ipv6/fib6_rules.c
@@ -53,6 +53,7 @@ static int fib6_rule_action(struct fib_r
 			    int flags, struct fib_lookup_arg *arg)
 {
 	struct rt6_info *rt = NULL;
+	struct net *net = flp->fl_net;
 	struct fib6_table *table;
 	pol_lookup_t lookup = arg->lookup_ptr;
 
@@ -71,7 +72,7 @@ static int fib6_rule_action(struct fib_r
 		goto discard_pkt;
 	}
 
-	table = fib6_get_table(&init_net, rule->table);
+	table = fib6_get_table(net, rule->table);
 	if (table)
 		rt = lookup(table, flp, flags);
 
@@ -145,13 +146,14 @@ static int fib6_rule_configure(struct fi
 			       struct nlattr **tb)
 {
 	int err = -EINVAL;
+	struct net *net = skb->sk->sk_net;
 	struct fib6_rule *rule6 = (struct fib6_rule *) rule;
 
 	if (rule->action == FR_ACT_TO_TBL) {
 		if (rule->table == RT6_TABLE_UNSPEC)
 			goto errout;
 
-		if (fib6_new_table(&init_net, rule->table) == NULL) {
+		if (fib6_new_table(net, rule->table) == NULL) {
 			err = -ENOBUFS;
 			goto errout;
 		}

-- 


More information about the Containers mailing list