hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/ipv6/udplite.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * UDPLITEv6 An implementation of the UDP-Lite protocol over IPv6.
34 * See also net/ipv4/udplite.c
....@@ -6,25 +7,29 @@
67 *
78 * Changes:
89 * Fixes:
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License
11
- * as published by the Free Software Foundation; either version
12
- * 2 of the License, or (at your option) any later version.
1310 */
1411 #include <linux/export.h>
1512 #include <linux/proc_fs.h>
1613 #include "udp_impl.h"
14
+
15
+static int udplitev6_sk_init(struct sock *sk)
16
+{
17
+ udpv6_init_sock(sk);
18
+ udp_sk(sk)->pcflag = UDPLITE_BIT;
19
+ return 0;
20
+}
1721
1822 static int udplitev6_rcv(struct sk_buff *skb)
1923 {
2024 return __udp6_lib_rcv(skb, &udplite_table, IPPROTO_UDPLITE);
2125 }
2226
23
-static void udplitev6_err(struct sk_buff *skb,
27
+static int udplitev6_err(struct sk_buff *skb,
2428 struct inet6_skb_parm *opt,
2529 u8 type, u8 code, int offset, __be32 info)
2630 {
27
- __udp6_lib_err(skb, opt, type, code, offset, info, &udplite_table);
31
+ return __udp6_lib_err(skb, opt, type, code, offset, info,
32
+ &udplite_table);
2833 }
2934
3035 static const struct inet6_protocol udplitev6_protocol = {
....@@ -40,7 +45,7 @@
4045 .connect = ip6_datagram_connect,
4146 .disconnect = udp_disconnect,
4247 .ioctl = udp_ioctl,
43
- .init = udplite_sk_init,
48
+ .init = udplitev6_sk_init,
4449 .destroy = udpv6_destroy_sock,
4550 .setsockopt = udpv6_setsockopt,
4651 .getsockopt = udpv6_getsockopt,
....@@ -48,15 +53,14 @@
4853 .recvmsg = udpv6_recvmsg,
4954 .hash = udp_lib_hash,
5055 .unhash = udp_lib_unhash,
56
+ .rehash = udp_v6_rehash,
5157 .get_port = udp_v6_get_port,
5258 .memory_allocated = &udp_memory_allocated,
5359 .sysctl_mem = sysctl_udp_mem,
60
+ .sysctl_wmem_offset = offsetof(struct net, ipv4.sysctl_udp_wmem_min),
61
+ .sysctl_rmem_offset = offsetof(struct net, ipv4.sysctl_udp_rmem_min),
5462 .obj_size = sizeof(struct udp6_sock),
5563 .h.udp_table = &udplite_table,
56
-#ifdef CONFIG_COMPAT
57
- .compat_setsockopt = compat_udpv6_setsockopt,
58
- .compat_getsockopt = compat_udpv6_getsockopt,
59
-#endif
6064 };
6165
6266 static struct inet_protosw udplite6_protosw = {