OpenVZ Forum


Home » Mailing lists » Devel » [patch 20/38][IPV6] fib6_rules - make fib_rules per network namespace
[patch 20/38][IPV6] fib6_rules - make fib_rules per network namespace [message #24277] Mon, 03 December 2007 16:16
Daniel Lezcano is currently offline  Daniel Lezcano
Messages: 417
Registered: June 2006
Senior Member
This patch makes the fib6_rules per network namespace.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Benjamin Thery <benjamin.thery@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;
 		}

-- 
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: [patch 19/38][IPV6] ip6_fib - make the ip6 fib gc timer handle several network namespaces
Next Topic: [patch 21/38][IPV6] rt6_stats - make mindless changes for rt6_stats
Goto Forum:
  


Current Time: Mon Aug 11 23:06:07 GMT 2025

Total time taken to generate the page: 0.46466 seconds