aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorDaniel Lezcano <dlezcano@fr.ibm.com>2008-01-10 05:53:43 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:01:17 -0500
commit760f2d0186225f06d46e07232d65219c5055cad3 (patch)
tree56096a88e003753434c135d22ffab8f4f9904bc6 /net/ipv6/route.c
parent89918fc270bb77cb1a0703f0ea566a692b32e324 (diff)
[NETNS][IPV6]: Make multiple instance of sysctl tables.
Each network namespace wants its own set of sysctl value, eg. we should not be able from a namespace to set a sysctl value for another namespace , especially for the initial network namespace. This patch duplicates the sysctl table when we register a new network namespace for ipv6. The duplicated table are postfixed with the "template" word to notify the developper the table is cloned. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b80ef5784207..0c7382f4fb85 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2409,7 +2409,7 @@ int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, struct file * filp,
2409 return -EINVAL; 2409 return -EINVAL;
2410} 2410}
2411 2411
2412ctl_table ipv6_route_table[] = { 2412ctl_table ipv6_route_table_template[] = {
2413 { 2413 {
2414 .procname = "flush", 2414 .procname = "flush",
2415 .data = &flush_delay, 2415 .data = &flush_delay,
@@ -2499,6 +2499,15 @@ ctl_table ipv6_route_table[] = {
2499 { .ctl_name = 0 } 2499 { .ctl_name = 0 }
2500}; 2500};
2501 2501
2502struct ctl_table *ipv6_route_sysctl_init(struct net *net)
2503{
2504 struct ctl_table *table;
2505
2506 table = kmemdup(ipv6_route_table_template,
2507 sizeof(ipv6_route_table_template),
2508 GFP_KERNEL);
2509 return table;
2510}
2502#endif 2511#endif
2503 2512
2504int __init ip6_route_init(void) 2513int __init ip6_route_init(void)