net: ipv6: Fix ping to link-local addresses.
authorLorenzo Colitti <lorenzo@google.com>
Fri, 12 Aug 2016 16:13:38 +0000 (01:13 +0900)
committerDanny Wood <danwood76@gmail.com>
Tue, 28 Jul 2020 08:47:01 +0000 (09:47 +0100)
commit70d7432bc199dce6d6bb3bff62239f9c30675289
tree76c8ca86ffc750cd834ecf4dd9f3862f2a26b3bf
parent322f496d0fa2ea9cb0afb1a35c84d0292fd64894
net: ipv6: Fix ping to link-local addresses.

ping_v6_sendmsg does not set flowi6_oif in response to
sin6_scope_id or sk_bound_dev_if, so it is not possible to use
these APIs to ping an IPv6 address on a different interface.
Instead, it sets flowi6_iif, which is incorrect but harmless.

Stop setting flowi6_iif, and support various ways of setting oif
in the same priority order used by udpv6_sendmsg.

[Backport of net 5e457896986e16c440c97bb94b9ccd95dd157292]

Bug: 29370996
Change-Id: I2c8bc213c417a4427f64439e0954138cb30416c2
Tested: https://android-review.googlesource.com/#/c/254470/
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Corinna Vinschen <xda@vinschen.de>
net/ipv6/ping.c