diff options
author | Denis V. Lunev <den@openvz.org> | 2008-01-10 06:17:29 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:01:21 -0500 |
commit | f8c26b8d589867aed8251db2935f8aa03aa68717 (patch) | |
tree | a96938be9494e60365d10c652cb3e7c9d3dcee18 | |
parent | 41a76906b3225997036efd88cbaae69d60b1e947 (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>
-rw-r--r-- | include/net/fib_rules.h | 4 | ||||
-rw-r--r-- | net/core/fib_rules.c | 4 | ||||
-rw-r--r-- | net/decnet/dn_rules.c | 4 | ||||
-rw-r--r-- | net/ipv4/fib_rules.c | 2 | ||||
-rw-r--r-- | net/ipv6/fib6_rules.c | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 2364db1a47..f7351b0ad5 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -101,8 +101,8 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) | |||
101 | return frh->table; | 101 | return frh->table; |
102 | } | 102 | } |
103 | 103 | ||
104 | extern int fib_rules_register(struct fib_rules_ops *); | 104 | extern int fib_rules_register(struct net *, struct fib_rules_ops *); |
105 | extern int fib_rules_unregister(struct fib_rules_ops *); | 105 | extern int fib_rules_unregister(struct net *, struct fib_rules_ops *); |
106 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); | 106 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); |
107 | 107 | ||
108 | extern int fib_rules_lookup(struct fib_rules_ops *, | 108 | extern int fib_rules_lookup(struct fib_rules_ops *, |
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index fcbf41c0a5..ada9c8155e 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 | ||
77 | int fib_rules_register(struct fib_rules_ops *ops) | 77 | int 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 | } |
114 | EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops); | 114 | EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops); |
115 | 115 | ||
116 | int fib_rules_unregister(struct fib_rules_ops *ops) | 116 | int 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 ffebea04cc..0b5e2b97e1 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 | ||
261 | void __exit dn_fib_rules_cleanup(void) | 261 | void __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 a0ada3a8d8..eac3f717ec 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) | |||
314 | void __init fib4_rules_init(void) | 314 | void __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 9ce2e0a674..e4d7e5a08b 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; |
279 | out: | 279 | out: |
@@ -286,5 +286,5 @@ out_default_rules_init: | |||
286 | 286 | ||
287 | void fib6_rules_cleanup(void) | 287 | void fib6_rules_cleanup(void) |
288 | { | 288 | { |
289 | fib_rules_unregister(&fib6_rules_ops); | 289 | fib_rules_unregister(&init_net, &fib6_rules_ops); |
290 | } | 290 | } |