proc.c (c3f6c21d6e60e39c81c27f18ebad9c7615eff545) proc.c (2c8c1e7297e19bdef3c178c3ea41d898a7716e3e)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * This file implements the various access functions for the
7 * PROC file system. This is very similar to the IPv4 version,
8 * except it reports the sockets in the INET6 address family.

--- 253 unchanged lines hidden (view full) ---

262 if (!idev->stats.proc_dir_entry)
263 return -EINVAL;
264 remove_proc_entry(idev->stats.proc_dir_entry->name,
265 net->mib.proc_net_devsnmp6);
266 idev->stats.proc_dir_entry = NULL;
267 return 0;
268}
269
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * This file implements the various access functions for the
7 * PROC file system. This is very similar to the IPv4 version,
8 * except it reports the sockets in the INET6 address family.

--- 253 unchanged lines hidden (view full) ---

262 if (!idev->stats.proc_dir_entry)
263 return -EINVAL;
264 remove_proc_entry(idev->stats.proc_dir_entry->name,
265 net->mib.proc_net_devsnmp6);
266 idev->stats.proc_dir_entry = NULL;
267 return 0;
268}
269
270static int ipv6_proc_init_net(struct net *net)
270static int __net_init ipv6_proc_init_net(struct net *net)
271{
272 if (!proc_net_fops_create(net, "sockstat6", S_IRUGO,
273 &sockstat6_seq_fops))
274 return -ENOMEM;
275
276 if (!proc_net_fops_create(net, "snmp6", S_IRUGO, &snmp6_seq_fops))
277 goto proc_snmp6_fail;
278

--- 4 unchanged lines hidden (view full) ---

283
284proc_snmp6_fail:
285 proc_net_remove(net, "sockstat6");
286proc_dev_snmp6_fail:
287 proc_net_remove(net, "dev_snmp6");
288 return -ENOMEM;
289}
290
271{
272 if (!proc_net_fops_create(net, "sockstat6", S_IRUGO,
273 &sockstat6_seq_fops))
274 return -ENOMEM;
275
276 if (!proc_net_fops_create(net, "snmp6", S_IRUGO, &snmp6_seq_fops))
277 goto proc_snmp6_fail;
278

--- 4 unchanged lines hidden (view full) ---

283
284proc_snmp6_fail:
285 proc_net_remove(net, "sockstat6");
286proc_dev_snmp6_fail:
287 proc_net_remove(net, "dev_snmp6");
288 return -ENOMEM;
289}
290
291static void ipv6_proc_exit_net(struct net *net)
291static void __net_exit ipv6_proc_exit_net(struct net *net)
292{
293 proc_net_remove(net, "sockstat6");
294 proc_net_remove(net, "dev_snmp6");
295 proc_net_remove(net, "snmp6");
296}
297
298static struct pernet_operations ipv6_proc_ops = {
299 .init = ipv6_proc_init_net,

--- 13 unchanged lines hidden ---
292{
293 proc_net_remove(net, "sockstat6");
294 proc_net_remove(net, "dev_snmp6");
295 proc_net_remove(net, "snmp6");
296}
297
298static struct pernet_operations ipv6_proc_ops = {
299 .init = ipv6_proc_init_net,

--- 13 unchanged lines hidden ---