Skip to content

Commit d839a0e

Browse files
Mike Manningdavem330
authored andcommitted
ipv6: allow ping to link-local address in VRF
If link-local packets are marked as enslaved to a VRF, then to allow ping to the link-local from a vrf, the error handling for IPV6_PKTINFO needs to be relaxed to also allow the pkt ipi6_ifindex to be that of a slave device to the vrf. Note that the real device also needs to be retrieved in icmp6_iif() to set the ipv6 flow oif to this for icmp echo reply handling. The recent commit 24b711e ("net/ipv6: Fix linklocal to global address with VRF") takes care of this, so the sdif does not need checking here. This fix makes ping to link-local consistent with that to global addresses, in that this can now be done from within the same VRF that the address is in. Signed-off-by: Mike Manning <[email protected]> Reviewed-by: David Ahern <[email protected]> Tested-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6f12fa7 commit d839a0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/ipv6_sockglue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
486486
retv = -EFAULT;
487487
break;
488488
}
489-
if (sk->sk_bound_dev_if && pkt.ipi6_ifindex != sk->sk_bound_dev_if)
489+
if (!sk_dev_equal_l3scope(sk, pkt.ipi6_ifindex))
490490
goto e_inval;
491491

492492
np->sticky_pktinfo.ipi6_ifindex = pkt.ipi6_ifindex;

0 commit comments

Comments
 (0)