diff options
Diffstat (limited to 'net/ipv6/proc.c')
-rw-r--r-- | net/ipv6/proc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index c9605c3ad91..bfe2598dd56 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -59,7 +59,7 @@ static const struct file_operations sockstat6_seq_fops = { | |||
59 | .release = single_release_net, | 59 | .release = single_release_net, |
60 | }; | 60 | }; |
61 | 61 | ||
62 | static struct snmp_mib snmp6_ipstats_list[] = { | 62 | static const struct snmp_mib snmp6_ipstats_list[] = { |
63 | /* ipv6 mib according to RFC 2465 */ | 63 | /* ipv6 mib according to RFC 2465 */ |
64 | SNMP_MIB_ITEM("Ip6InReceives", IPSTATS_MIB_INPKTS), | 64 | SNMP_MIB_ITEM("Ip6InReceives", IPSTATS_MIB_INPKTS), |
65 | SNMP_MIB_ITEM("Ip6InHdrErrors", IPSTATS_MIB_INHDRERRORS), | 65 | SNMP_MIB_ITEM("Ip6InHdrErrors", IPSTATS_MIB_INHDRERRORS), |
@@ -92,7 +92,7 @@ static struct snmp_mib snmp6_ipstats_list[] = { | |||
92 | SNMP_MIB_SENTINEL | 92 | SNMP_MIB_SENTINEL |
93 | }; | 93 | }; |
94 | 94 | ||
95 | static struct snmp_mib snmp6_icmp6_list[] = { | 95 | static const struct snmp_mib snmp6_icmp6_list[] = { |
96 | /* icmpv6 mib according to RFC 2466 */ | 96 | /* icmpv6 mib according to RFC 2466 */ |
97 | SNMP_MIB_ITEM("Icmp6InMsgs", ICMP6_MIB_INMSGS), | 97 | SNMP_MIB_ITEM("Icmp6InMsgs", ICMP6_MIB_INMSGS), |
98 | SNMP_MIB_ITEM("Icmp6InErrors", ICMP6_MIB_INERRORS), | 98 | SNMP_MIB_ITEM("Icmp6InErrors", ICMP6_MIB_INERRORS), |
@@ -120,7 +120,7 @@ static const char *const icmp6type2name[256] = { | |||
120 | }; | 120 | }; |
121 | 121 | ||
122 | 122 | ||
123 | static struct snmp_mib snmp6_udp6_list[] = { | 123 | static const struct snmp_mib snmp6_udp6_list[] = { |
124 | SNMP_MIB_ITEM("Udp6InDatagrams", UDP_MIB_INDATAGRAMS), | 124 | SNMP_MIB_ITEM("Udp6InDatagrams", UDP_MIB_INDATAGRAMS), |
125 | SNMP_MIB_ITEM("Udp6NoPorts", UDP_MIB_NOPORTS), | 125 | SNMP_MIB_ITEM("Udp6NoPorts", UDP_MIB_NOPORTS), |
126 | SNMP_MIB_ITEM("Udp6InErrors", UDP_MIB_INERRORS), | 126 | SNMP_MIB_ITEM("Udp6InErrors", UDP_MIB_INERRORS), |
@@ -128,7 +128,7 @@ static struct snmp_mib snmp6_udp6_list[] = { | |||
128 | SNMP_MIB_SENTINEL | 128 | SNMP_MIB_SENTINEL |
129 | }; | 129 | }; |
130 | 130 | ||
131 | static struct snmp_mib snmp6_udplite6_list[] = { | 131 | static const struct snmp_mib snmp6_udplite6_list[] = { |
132 | SNMP_MIB_ITEM("UdpLite6InDatagrams", UDP_MIB_INDATAGRAMS), | 132 | SNMP_MIB_ITEM("UdpLite6InDatagrams", UDP_MIB_INDATAGRAMS), |
133 | SNMP_MIB_ITEM("UdpLite6NoPorts", UDP_MIB_NOPORTS), | 133 | SNMP_MIB_ITEM("UdpLite6NoPorts", UDP_MIB_NOPORTS), |
134 | SNMP_MIB_ITEM("UdpLite6InErrors", UDP_MIB_INERRORS), | 134 | SNMP_MIB_ITEM("UdpLite6InErrors", UDP_MIB_INERRORS), |
@@ -170,8 +170,8 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | |||
170 | return; | 170 | return; |
171 | } | 171 | } |
172 | 172 | ||
173 | static inline void | 173 | static void snmp6_seq_show_item(struct seq_file *seq, void **mib, |
174 | snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_mib *itemlist) | 174 | const struct snmp_mib *itemlist) |
175 | { | 175 | { |
176 | int i; | 176 | int i; |
177 | for (i=0; itemlist[i].name; i++) | 177 | for (i=0; itemlist[i].name; i++) |
@@ -259,7 +259,7 @@ int snmp6_unregister_dev(struct inet6_dev *idev) | |||
259 | struct net *net = dev_net(idev->dev); | 259 | struct net *net = dev_net(idev->dev); |
260 | if (!net->mib.proc_net_devsnmp6) | 260 | if (!net->mib.proc_net_devsnmp6) |
261 | return -ENOENT; | 261 | return -ENOENT; |
262 | if (!idev || !idev->stats.proc_dir_entry) | 262 | if (!idev->stats.proc_dir_entry) |
263 | return -EINVAL; | 263 | return -EINVAL; |
264 | remove_proc_entry(idev->stats.proc_dir_entry->name, | 264 | remove_proc_entry(idev->stats.proc_dir_entry->name, |
265 | net->mib.proc_net_devsnmp6); | 265 | net->mib.proc_net_devsnmp6); |
@@ -267,7 +267,7 @@ int snmp6_unregister_dev(struct inet6_dev *idev) | |||
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
269 | 269 | ||
270 | static int ipv6_proc_init_net(struct net *net) | 270 | static int __net_init ipv6_proc_init_net(struct net *net) |
271 | { | 271 | { |
272 | if (!proc_net_fops_create(net, "sockstat6", S_IRUGO, | 272 | if (!proc_net_fops_create(net, "sockstat6", S_IRUGO, |
273 | &sockstat6_seq_fops)) | 273 | &sockstat6_seq_fops)) |
@@ -288,7 +288,7 @@ proc_dev_snmp6_fail: | |||
288 | return -ENOMEM; | 288 | return -ENOMEM; |
289 | } | 289 | } |
290 | 290 | ||
291 | static void ipv6_proc_exit_net(struct net *net) | 291 | static void __net_exit ipv6_proc_exit_net(struct net *net) |
292 | { | 292 | { |
293 | proc_net_remove(net, "sockstat6"); | 293 | proc_net_remove(net, "sockstat6"); |
294 | proc_net_remove(net, "dev_snmp6"); | 294 | proc_net_remove(net, "dev_snmp6"); |