diff options
Diffstat (limited to 'net/sysctl_net.c')
-rw-r--r-- | net/sysctl_net.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/sysctl_net.c b/net/sysctl_net.c index 63ada437fc2f..972201cd5fa7 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c | |||
@@ -29,10 +29,15 @@ | |||
29 | #include <linux/if_tr.h> | 29 | #include <linux/if_tr.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | static struct list_head * | 32 | static struct ctl_table_set * |
33 | net_ctl_header_lookup(struct ctl_table_root *root, struct nsproxy *namespaces) | 33 | net_ctl_header_lookup(struct ctl_table_root *root, struct nsproxy *namespaces) |
34 | { | 34 | { |
35 | return &namespaces->net_ns->sysctl_table_headers; | 35 | return &namespaces->net_ns->sysctls; |
36 | } | ||
37 | |||
38 | static int is_seen(struct ctl_table_set *set) | ||
39 | { | ||
40 | return ¤t->nsproxy->net_ns->sysctls == set; | ||
36 | } | 41 | } |
37 | 42 | ||
38 | /* Return standard mode bits for table entry. */ | 43 | /* Return standard mode bits for table entry. */ |
@@ -53,13 +58,6 @@ static struct ctl_table_root net_sysctl_root = { | |||
53 | .permissions = net_ctl_permissions, | 58 | .permissions = net_ctl_permissions, |
54 | }; | 59 | }; |
55 | 60 | ||
56 | static LIST_HEAD(net_sysctl_ro_tables); | ||
57 | static struct list_head *net_ctl_ro_header_lookup(struct ctl_table_root *root, | ||
58 | struct nsproxy *namespaces) | ||
59 | { | ||
60 | return &net_sysctl_ro_tables; | ||
61 | } | ||
62 | |||
63 | static int net_ctl_ro_header_perms(struct ctl_table_root *root, | 61 | static int net_ctl_ro_header_perms(struct ctl_table_root *root, |
64 | struct nsproxy *namespaces, struct ctl_table *table) | 62 | struct nsproxy *namespaces, struct ctl_table *table) |
65 | { | 63 | { |
@@ -70,19 +68,20 @@ static int net_ctl_ro_header_perms(struct ctl_table_root *root, | |||
70 | } | 68 | } |
71 | 69 | ||
72 | static struct ctl_table_root net_sysctl_ro_root = { | 70 | static struct ctl_table_root net_sysctl_ro_root = { |
73 | .lookup = net_ctl_ro_header_lookup, | ||
74 | .permissions = net_ctl_ro_header_perms, | 71 | .permissions = net_ctl_ro_header_perms, |
75 | }; | 72 | }; |
76 | 73 | ||
77 | static int sysctl_net_init(struct net *net) | 74 | static int sysctl_net_init(struct net *net) |
78 | { | 75 | { |
79 | INIT_LIST_HEAD(&net->sysctl_table_headers); | 76 | setup_sysctl_set(&net->sysctls, |
77 | &net_sysctl_ro_root.default_set, | ||
78 | is_seen); | ||
80 | return 0; | 79 | return 0; |
81 | } | 80 | } |
82 | 81 | ||
83 | static void sysctl_net_exit(struct net *net) | 82 | static void sysctl_net_exit(struct net *net) |
84 | { | 83 | { |
85 | WARN_ON(!list_empty(&net->sysctl_table_headers)); | 84 | WARN_ON(!list_empty(&net->sysctls.list)); |
86 | return; | 85 | return; |
87 | } | 86 | } |
88 | 87 | ||
@@ -98,6 +97,7 @@ static __init int sysctl_init(void) | |||
98 | if (ret) | 97 | if (ret) |
99 | goto out; | 98 | goto out; |
100 | register_sysctl_root(&net_sysctl_root); | 99 | register_sysctl_root(&net_sysctl_root); |
100 | setup_sysctl_set(&net_sysctl_ro_root.default_set, NULL, NULL); | ||
101 | register_sysctl_root(&net_sysctl_ro_root); | 101 | register_sysctl_root(&net_sysctl_ro_root); |
102 | out: | 102 | out: |
103 | return ret; | 103 | return ret; |