diff options
-rw-r--r-- | include/net/ip_fib.h | 4 | ||||
-rw-r--r-- | net/ipv4/af_inet.c | 4 | ||||
-rw-r--r-- | net/ipv4/fib_hash.c | 8 | ||||
-rw-r--r-- | net/ipv4/fib_trie.c | 21 |
4 files changed, 19 insertions, 18 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index d70b9b49f8b1..f74cbb21af45 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -253,8 +253,8 @@ static inline void fib_res_put(struct fib_result *res) | |||
253 | } | 253 | } |
254 | 254 | ||
255 | #ifdef CONFIG_PROC_FS | 255 | #ifdef CONFIG_PROC_FS |
256 | extern int fib_proc_init(void); | 256 | extern int __net_init fib_proc_init(struct net *net); |
257 | extern void fib_proc_exit(void); | 257 | extern void __net_exit fib_proc_exit(struct net *net); |
258 | #endif | 258 | #endif |
259 | 259 | ||
260 | #endif /* _NET_FIB_H */ | 260 | #endif /* _NET_FIB_H */ |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 0e12cf646071..d5b8cb1dad67 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1475,14 +1475,14 @@ static int __init ipv4_proc_init(void) | |||
1475 | goto out_tcp; | 1475 | goto out_tcp; |
1476 | if (udp4_proc_init()) | 1476 | if (udp4_proc_init()) |
1477 | goto out_udp; | 1477 | goto out_udp; |
1478 | if (fib_proc_init()) | 1478 | if (fib_proc_init(&init_net)) |
1479 | goto out_fib; | 1479 | goto out_fib; |
1480 | if (ip_misc_proc_init()) | 1480 | if (ip_misc_proc_init()) |
1481 | goto out_misc; | 1481 | goto out_misc; |
1482 | out: | 1482 | out: |
1483 | return rc; | 1483 | return rc; |
1484 | out_misc: | 1484 | out_misc: |
1485 | fib_proc_exit(); | 1485 | fib_proc_exit(&init_net); |
1486 | out_fib: | 1486 | out_fib: |
1487 | udp4_proc_exit(); | 1487 | udp4_proc_exit(); |
1488 | out_udp: | 1488 | out_udp: |
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index ee1ffdb3044f..8de21bc4947a 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c | |||
@@ -1041,15 +1041,15 @@ static const struct file_operations fib_seq_fops = { | |||
1041 | .release = seq_release_private, | 1041 | .release = seq_release_private, |
1042 | }; | 1042 | }; |
1043 | 1043 | ||
1044 | int __init fib_proc_init(void) | 1044 | int __net_init fib_proc_init(struct net *net) |
1045 | { | 1045 | { |
1046 | if (!proc_net_fops_create(&init_net, "route", S_IRUGO, &fib_seq_fops)) | 1046 | if (!proc_net_fops_create(net, "route", S_IRUGO, &fib_seq_fops)) |
1047 | return -ENOMEM; | 1047 | return -ENOMEM; |
1048 | return 0; | 1048 | return 0; |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | void __init fib_proc_exit(void) | 1051 | void __net_exit fib_proc_exit(struct net *net) |
1052 | { | 1052 | { |
1053 | proc_net_remove(&init_net, "route"); | 1053 | proc_net_remove(net, "route"); |
1054 | } | 1054 | } |
1055 | #endif /* CONFIG_PROC_FS */ | 1055 | #endif /* CONFIG_PROC_FS */ |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index a842204df7ba..4bbfaeedf210 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -2508,32 +2508,33 @@ static const struct file_operations fib_route_fops = { | |||
2508 | .release = seq_release_private, | 2508 | .release = seq_release_private, |
2509 | }; | 2509 | }; |
2510 | 2510 | ||
2511 | int __init fib_proc_init(void) | 2511 | int __net_init fib_proc_init(struct net *net) |
2512 | { | 2512 | { |
2513 | if (!proc_net_fops_create(&init_net, "fib_trie", S_IRUGO, &fib_trie_fops)) | 2513 | if (!proc_net_fops_create(net, "fib_trie", S_IRUGO, &fib_trie_fops)) |
2514 | goto out1; | 2514 | goto out1; |
2515 | 2515 | ||
2516 | if (!proc_net_fops_create(&init_net, "fib_triestat", S_IRUGO, &fib_triestat_fops)) | 2516 | if (!proc_net_fops_create(net, "fib_triestat", S_IRUGO, |
2517 | &fib_triestat_fops)) | ||
2517 | goto out2; | 2518 | goto out2; |
2518 | 2519 | ||
2519 | if (!proc_net_fops_create(&init_net, "route", S_IRUGO, &fib_route_fops)) | 2520 | if (!proc_net_fops_create(net, "route", S_IRUGO, &fib_route_fops)) |
2520 | goto out3; | 2521 | goto out3; |
2521 | 2522 | ||
2522 | return 0; | 2523 | return 0; |
2523 | 2524 | ||
2524 | out3: | 2525 | out3: |
2525 | proc_net_remove(&init_net, "fib_triestat"); | 2526 | proc_net_remove(net, "fib_triestat"); |
2526 | out2: | 2527 | out2: |
2527 | proc_net_remove(&init_net, "fib_trie"); | 2528 | proc_net_remove(net, "fib_trie"); |
2528 | out1: | 2529 | out1: |
2529 | return -ENOMEM; | 2530 | return -ENOMEM; |
2530 | } | 2531 | } |
2531 | 2532 | ||
2532 | void __init fib_proc_exit(void) | 2533 | void __net_exit fib_proc_exit(struct net *net) |
2533 | { | 2534 | { |
2534 | proc_net_remove(&init_net, "fib_trie"); | 2535 | proc_net_remove(net, "fib_trie"); |
2535 | proc_net_remove(&init_net, "fib_triestat"); | 2536 | proc_net_remove(net, "fib_triestat"); |
2536 | proc_net_remove(&init_net, "route"); | 2537 | proc_net_remove(net, "route"); |
2537 | } | 2538 | } |
2538 | 2539 | ||
2539 | #endif /* CONFIG_PROC_FS */ | 2540 | #endif /* CONFIG_PROC_FS */ |