| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * INET An implementation of the TCP/IP protocol suite for the LINUX |
|---|
| 3 | 4 | * operating system. INET is implemented using the BSD Socket |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * "Ping" sockets |
|---|
| 7 | 8 | * |
|---|
| 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 | | - * |
|---|
| 13 | 9 | * Based on ipv4/ping.c code. |
|---|
| 14 | 10 | * |
|---|
| 15 | 11 | * Authors: Lorenzo Colitti (IPv6 support) |
|---|
| 16 | 12 | * Vasiliy Kulikov / Openwall (IPv4 implementation, for Linux 2.6), |
|---|
| 17 | 13 | * Pavel Kankovsky (IPv4 implementation, for Linux 2.4.32) |
|---|
| 18 | | - * |
|---|
| 19 | 14 | */ |
|---|
| 20 | 15 | |
|---|
| 21 | 16 | #include <net/addrconf.h> |
|---|
| .. | .. |
|---|
| 26 | 21 | #include <net/transp_v6.h> |
|---|
| 27 | 22 | #include <linux/proc_fs.h> |
|---|
| 28 | 23 | #include <net/ping.h> |
|---|
| 24 | + |
|---|
| 25 | +static void ping_v6_destroy(struct sock *sk) |
|---|
| 26 | +{ |
|---|
| 27 | + inet6_destroy_sock(sk); |
|---|
| 28 | +} |
|---|
| 29 | 29 | |
|---|
| 30 | 30 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ |
|---|
| 31 | 31 | static int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, |
|---|
| .. | .. |
|---|
| 116 | 116 | fl6.flowi6_uid = sk->sk_uid; |
|---|
| 117 | 117 | fl6.fl6_icmp_type = user_icmph.icmp6_type; |
|---|
| 118 | 118 | 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)); |
|---|
| 120 | 120 | |
|---|
| 121 | 121 | ipcm6_init_sk(&ipc6, np); |
|---|
| 122 | + ipc6.sockc.mark = sk->sk_mark; |
|---|
| 122 | 123 | fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel); |
|---|
| 123 | 124 | |
|---|
| 124 | 125 | dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr, false); |
|---|
| .. | .. |
|---|
| 170 | 171 | .owner = THIS_MODULE, |
|---|
| 171 | 172 | .init = ping_init_sock, |
|---|
| 172 | 173 | .close = ping_close, |
|---|
| 174 | + .destroy = ping_v6_destroy, |
|---|
| 173 | 175 | .connect = ip6_datagram_connect_v6_only, |
|---|
| 174 | 176 | .disconnect = __udp_disconnect, |
|---|
| 175 | 177 | .setsockopt = ipv6_setsockopt, |
|---|