aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-01-10 06:17:29 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:01:21 -0500
commitf8c26b8d589867aed8251db2935f8aa03aa68717 (patch)
treea96938be9494e60365d10c652cb3e7c9d3dcee18 /net
parent41a76906b3225997036efd88cbaae69d60b1e947 (diff)
[NETNS]: Add netns parameter to fib_rules_(un)register.
The patch extends the different fib rules API in order to pass the network namespace pointer. That will allow to access the different tables from a namespace relative object. As usual, the pointer to the init_net variable is passed as parameter so we don't break the network. 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>
Diffstat (limited to 'net')
-rw-r--r--net/core/fib_rules.c4
-rw-r--r--net/decnet/dn_rules.c4
-rw-r--r--net/ipv4/fib_rules.c2
-rw-r--r--net/ipv6/fib6_rules.c4
4 files changed, 7 insertions, 7 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index fcbf41c0a5d4..ada9c8155e3c 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -74,7 +74,7 @@ static void flush_route_cache(struct fib_rules_ops *ops)
74 ops->flush_cache(); 74 ops->flush_cache();
75} 75}
76 76
77int fib_rules_register(struct fib_rules_ops *ops) 77int fib_rules_register(struct net *net, struct fib_rules_ops *ops)
78{ 78{
79 int err = -EEXIST; 79 int err = -EEXIST;
80 struct fib_rules_ops *o; 80 struct fib_rules_ops *o;
@@ -113,7 +113,7 @@ void fib_rules_cleanup_ops(struct fib_rules_ops *ops)
113} 113}
114EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops); 114EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops);
115 115
116int fib_rules_unregister(struct fib_rules_ops *ops) 116int fib_rules_unregister(struct net *net, struct fib_rules_ops *ops)
117{ 117{
118 int err = 0; 118 int err = 0;
119 struct fib_rules_ops *o; 119 struct fib_rules_ops *o;
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index ffebea04cc99..0b5e2b97e15a 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -255,12 +255,12 @@ void __init dn_fib_rules_init(void)
255{ 255{
256 BUG_ON(fib_default_rule_add(&dn_fib_rules_ops, 0x7fff, 256 BUG_ON(fib_default_rule_add(&dn_fib_rules_ops, 0x7fff,
257 RT_TABLE_MAIN, 0)); 257 RT_TABLE_MAIN, 0));
258 fib_rules_register(&dn_fib_rules_ops); 258 fib_rules_register(&init_net, &dn_fib_rules_ops);
259} 259}
260 260
261void __exit dn_fib_rules_cleanup(void) 261void __exit dn_fib_rules_cleanup(void)
262{ 262{
263 fib_rules_unregister(&dn_fib_rules_ops); 263 fib_rules_unregister(&init_net, &dn_fib_rules_ops);
264} 264}
265 265
266 266
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index a0ada3a8d8dd..eac3f717ecab 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -314,5 +314,5 @@ static int __init fib_default_rules_init(void)
314void __init fib4_rules_init(void) 314void __init fib4_rules_init(void)
315{ 315{
316 BUG_ON(fib_default_rules_init()); 316 BUG_ON(fib_default_rules_init());
317 fib_rules_register(&fib4_rules_ops); 317 fib_rules_register(&init_net, &fib4_rules_ops);
318} 318}
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 9ce2e0a6748a..e4d7e5a08b40 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -273,7 +273,7 @@ int __init fib6_rules_init(void)
273 if (ret) 273 if (ret)
274 goto out; 274 goto out;
275 275
276 ret = fib_rules_register(&fib6_rules_ops); 276 ret = fib_rules_register(&init_net, &fib6_rules_ops);
277 if (ret) 277 if (ret)
278 goto out_default_rules_init; 278 goto out_default_rules_init;
279out: 279out:
@@ -286,5 +286,5 @@ out_default_rules_init:
286 286
287void fib6_rules_cleanup(void) 287void fib6_rules_cleanup(void)
288{ 288{
289 fib_rules_unregister(&fib6_rules_ops); 289 fib_rules_unregister(&init_net, &fib6_rules_ops);
290} 290}