hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/ipv6/ping.c
....@@ -22,11 +22,6 @@
2222 #include <linux/proc_fs.h>
2323 #include <net/ping.h>
2424
25
-static void ping_v6_destroy(struct sock *sk)
26
-{
27
- inet6_destroy_sock(sk);
28
-}
29
-
3025 /* Compatibility glue so we can support IPv6 when it's compiled as a module */
3126 static int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,
3227 int *addr_len)
....@@ -101,7 +96,8 @@
10196 addr_type = ipv6_addr_type(daddr);
10297 if ((__ipv6_addr_needs_scope_id(addr_type) && !oif) ||
10398 (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))
105101 return -EINVAL;
106102
107103 /* TODO: use ip6_datagram_send_ctl to get options from cmsg */
....@@ -171,7 +167,6 @@
171167 .owner = THIS_MODULE,
172168 .init = ping_init_sock,
173169 .close = ping_close,
174
- .destroy = ping_v6_destroy,
175170 .connect = ip6_datagram_connect_v6_only,
176171 .disconnect = __udp_disconnect,
177172 .setsockopt = ipv6_setsockopt,