forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/net/ipv6/ping.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * INET An implementation of the TCP/IP protocol suite for the LINUX
34 * operating system. INET is implemented using the BSD Socket
....@@ -5,17 +6,11 @@
56 *
67 * "Ping" sockets
78 *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * as published by the Free Software Foundation; either version
11
- * 2 of the License, or (at your option) any later version.
12
- *
139 * Based on ipv4/ping.c code.
1410 *
1511 * Authors: Lorenzo Colitti (IPv6 support)
1612 * Vasiliy Kulikov / Openwall (IPv4 implementation, for Linux 2.6),
1713 * Pavel Kankovsky (IPv4 implementation, for Linux 2.4.32)
18
- *
1914 */
2015
2116 #include <net/addrconf.h>
....@@ -26,6 +21,11 @@
2621 #include <net/transp_v6.h>
2722 #include <linux/proc_fs.h>
2823 #include <net/ping.h>
24
+
25
+static void ping_v6_destroy(struct sock *sk)
26
+{
27
+ inet6_destroy_sock(sk);
28
+}
2929
3030 /* Compatibility glue so we can support IPv6 when it's compiled as a module */
3131 static int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,
....@@ -116,9 +116,10 @@
116116 fl6.flowi6_uid = sk->sk_uid;
117117 fl6.fl6_icmp_type = user_icmph.icmp6_type;
118118 fl6.fl6_icmp_code = user_icmph.icmp6_code;
119
- security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
119
+ security_sk_classify_flow(sk, flowi6_to_flowi_common(&fl6));
120120
121121 ipcm6_init_sk(&ipc6, np);
122
+ ipc6.sockc.mark = sk->sk_mark;
122123 fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
123124
124125 dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr, false);
....@@ -170,6 +171,7 @@
170171 .owner = THIS_MODULE,
171172 .init = ping_init_sock,
172173 .close = ping_close,
174
+ .destroy = ping_v6_destroy,
173175 .connect = ip6_datagram_connect_v6_only,
174176 .disconnect = __udp_disconnect,
175177 .setsockopt = ipv6_setsockopt,