summaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index ea0730028e5d..29adddeac3e5 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1480,31 +1480,43 @@ int udp6_seq_show(struct seq_file *seq, void *v)
1480 return 0; 1480 return 0;
1481} 1481}
1482 1482
1483static const struct file_operations udp6_afinfo_seq_fops = { 1483static const struct seq_operations udp6_seq_ops = {
1484 .open = udp_seq_open, 1484 .start = udp_seq_start,
1485 .next = udp_seq_next,
1486 .stop = udp_seq_stop,
1487 .show = udp6_seq_show,
1488};
1489
1490static int udp6_seq_open(struct inode *inode, struct file *file)
1491{
1492 return seq_open_net(inode, file, &udp6_seq_ops,
1493 sizeof(struct udp_iter_state));
1494}
1495
1496const struct file_operations udp6_afinfo_seq_fops = {
1497 .open = udp6_seq_open,
1485 .read = seq_read, 1498 .read = seq_read,
1486 .llseek = seq_lseek, 1499 .llseek = seq_lseek,
1487 .release = seq_release_net 1500 .release = seq_release_net
1488}; 1501};
1502EXPORT_SYMBOL(udp6_afinfo_seq_fops);
1489 1503
1490static struct udp_seq_afinfo udp6_seq_afinfo = { 1504static struct udp_seq_afinfo udp6_seq_afinfo = {
1491 .name = "udp6",
1492 .family = AF_INET6, 1505 .family = AF_INET6,
1493 .udp_table = &udp_table, 1506 .udp_table = &udp_table,
1494 .seq_fops = &udp6_afinfo_seq_fops,
1495 .seq_ops = {
1496 .show = udp6_seq_show,
1497 },
1498}; 1507};
1499 1508
1500int __net_init udp6_proc_init(struct net *net) 1509int __net_init udp6_proc_init(struct net *net)
1501{ 1510{
1502 return udp_proc_register(net, &udp6_seq_afinfo); 1511 if (!proc_create_data("udp6", 0444, net->proc_net,
1512 &udp6_afinfo_seq_fops, &udp6_seq_afinfo))
1513 return -ENOMEM;
1514 return 0;
1503} 1515}
1504 1516
1505void udp6_proc_exit(struct net *net) 1517void udp6_proc_exit(struct net *net)
1506{ 1518{
1507 udp_proc_unregister(net, &udp6_seq_afinfo); 1519 remove_proc_entry("udp6", net->proc_net);
1508} 1520}
1509#endif /* CONFIG_PROC_FS */ 1521#endif /* CONFIG_PROC_FS */
1510 1522