]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipv6: Allow connect to linklocal address from socket bound to vrf
authorDavid Ahern <dsahern@gmail.com>
Thu, 4 Jan 2018 22:03:54 +0000 (14:03 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Jan 2018 19:11:18 +0000 (14:11 -0500)
commit63b12cf77b889347ac5d7a33c8f59729408c5aeb
treef96d0686fcc8f9c55c47981c6edc70cfe827aab7
parent606a1ccece7880281fdb62328c1cabd09bf81a4a
net: ipv6: Allow connect to linklocal address from socket bound to vrf

Allow a process bound to a VRF to connect to a linklocal address.
Currently, this fails because of a mismatch between the scope of the
linklocal address and the sk_bound_dev_if inherited by the VRF binding:
    $ ssh -6 fe80::70b8:cff:fedd:ead8%eth1
    ssh: connect to host fe80::70b8:cff:fedd:ead8%eth1 port 22: Invalid argument

Relax the scope check to allow the socket to be bound to the same L3
device as the scope id.

This makes ipv6 linklocal consistent with other relaxed checks enabled
by commits 4aa60ea464ad ("net: l3mdev: Allow send on enslaved interface")
and 1dcd6f8a2e37b ("net: Allow IP_MULTICAST_IF to set index to L3 slave").

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/ipv6/datagram.c
net/ipv6/tcp_ipv6.c