| .. | .. |
|---|
| 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> |
|---|
| .. | .. |
|---|
| 101 | 96 | addr_type = ipv6_addr_type(daddr); |
|---|
| 102 | 97 | if ((__ipv6_addr_needs_scope_id(addr_type) && !oif) || |
|---|
| 103 | 98 | (addr_type & IPV6_ADDR_MAPPED) || |
|---|
| 104 | | - (oif && sk->sk_bound_dev_if && oif != sk->sk_bound_dev_if)) |
|---|
| 99 | + (oif && sk->sk_bound_dev_if && oif != sk->sk_bound_dev_if && |
|---|
| 100 | + l3mdev_master_ifindex_by_index(sock_net(sk), oif) != sk->sk_bound_dev_if)) |
|---|
| 105 | 101 | return -EINVAL; |
|---|
| 106 | 102 | |
|---|
| 107 | 103 | /* TODO: use ip6_datagram_send_ctl to get options from cmsg */ |
|---|
| .. | .. |
|---|
| 116 | 112 | fl6.flowi6_uid = sk->sk_uid; |
|---|
| 117 | 113 | fl6.fl6_icmp_type = user_icmph.icmp6_type; |
|---|
| 118 | 114 | fl6.fl6_icmp_code = user_icmph.icmp6_code; |
|---|
| 119 | | - security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); |
|---|
| 115 | + security_sk_classify_flow(sk, flowi6_to_flowi_common(&fl6)); |
|---|
| 120 | 116 | |
|---|
| 121 | 117 | ipcm6_init_sk(&ipc6, np); |
|---|
| 118 | + ipc6.sockc.mark = sk->sk_mark; |
|---|
| 122 | 119 | fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel); |
|---|
| 123 | 120 | |
|---|
| 124 | 121 | dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr, false); |
|---|