aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udplite.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/udplite.c')
-rw-r--r--net/ipv6/udplite.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 87d4202522ee..491efd00a866 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -35,13 +35,6 @@ static struct inet6_protocol udplitev6_protocol = {
35 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, 35 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
36}; 36};
37 37
38static int udplite_v6_get_port(struct sock *sk, unsigned short snum)
39{
40 return udplite_get_port(sk, snum, ipv6_rcv_saddr_equal);
41}
42
43DEFINE_PROTO_INUSE(udplitev6)
44
45struct proto udplitev6_prot = { 38struct proto udplitev6_prot = {
46 .name = "UDPLITEv6", 39 .name = "UDPLITEv6",
47 .owner = THIS_MODULE, 40 .owner = THIS_MODULE,
@@ -58,13 +51,13 @@ struct proto udplitev6_prot = {
58 .backlog_rcv = udpv6_queue_rcv_skb, 51 .backlog_rcv = udpv6_queue_rcv_skb,
59 .hash = udp_lib_hash, 52 .hash = udp_lib_hash,
60 .unhash = udp_lib_unhash, 53 .unhash = udp_lib_unhash,
61 .get_port = udplite_v6_get_port, 54 .get_port = udp_v6_get_port,
62 .obj_size = sizeof(struct udp6_sock), 55 .obj_size = sizeof(struct udp6_sock),
56 .h.udp_hash = udplite_hash,
63#ifdef CONFIG_COMPAT 57#ifdef CONFIG_COMPAT
64 .compat_setsockopt = compat_udpv6_setsockopt, 58 .compat_setsockopt = compat_udpv6_setsockopt,
65 .compat_getsockopt = compat_udpv6_getsockopt, 59 .compat_getsockopt = compat_udpv6_getsockopt,
66#endif 60#endif
67 REF_PROTO_INUSE(udplitev6)
68}; 61};
69 62
70static struct inet_protosw udplite6_protosw = { 63static struct inet_protosw udplite6_protosw = {
@@ -103,23 +96,40 @@ void udplitev6_exit(void)
103} 96}
104 97
105#ifdef CONFIG_PROC_FS 98#ifdef CONFIG_PROC_FS
106static struct file_operations udplite6_seq_fops;
107static struct udp_seq_afinfo udplite6_seq_afinfo = { 99static struct udp_seq_afinfo udplite6_seq_afinfo = {
108 .owner = THIS_MODULE,
109 .name = "udplite6", 100 .name = "udplite6",
110 .family = AF_INET6, 101 .family = AF_INET6,
111 .hashtable = udplite_hash, 102 .hashtable = udplite_hash,
112 .seq_show = udp6_seq_show, 103 .seq_fops = {
113 .seq_fops = &udplite6_seq_fops, 104 .owner = THIS_MODULE,
105 },
106 .seq_ops = {
107 .show = udp6_seq_show,
108 },
109};
110
111static int udplite6_proc_init_net(struct net *net)
112{
113 return udp_proc_register(net, &udplite6_seq_afinfo);
114}
115
116static void udplite6_proc_exit_net(struct net *net)
117{
118 udp_proc_unregister(net, &udplite6_seq_afinfo);
119}
120
121static struct pernet_operations udplite6_net_ops = {
122 .init = udplite6_proc_init_net,
123 .exit = udplite6_proc_exit_net,
114}; 124};
115 125
116int __init udplite6_proc_init(void) 126int __init udplite6_proc_init(void)
117{ 127{
118 return udp_proc_register(&udplite6_seq_afinfo); 128 return register_pernet_subsys(&udplite6_net_ops);
119} 129}
120 130
121void udplite6_proc_exit(void) 131void udplite6_proc_exit(void)
122{ 132{
123 udp_proc_unregister(&udplite6_seq_afinfo); 133 unregister_pernet_subsys(&udplite6_net_ops);
124} 134}
125#endif 135#endif