]> git.baikalelectronics.ru Git - kernel.git/commit
net: allow binding socket in a VRF when there's an unbound socket
authorRobert Shearman <rshearma@vyatta.att-mail.com>
Wed, 7 Nov 2018 15:36:02 +0000 (15:36 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Nov 2018 00:12:38 +0000 (16:12 -0800)
commit8c9af45424d6f7bf13f430fefd905f65f95e2af2
treea281d34b7cdb8bf01fe13c387ab95bce8bd87e81
parentb68855e18bb1b482fd682d6fd40e3fd2e13a43a9
net: allow binding socket in a VRF when there's an unbound socket

Change the inet socket lookup to avoid packets arriving on a device
enslaved to an l3mdev from matching unbound sockets by removing the
wildcard for non sk_bound_dev_if and instead relying on check against
the secondary device index, which will be 0 when the input device is
not enslaved to an l3mdev and so match against an unbound socket and
not match when the input device is enslaved.

Change the socket binding to take the l3mdev into account to allow an
unbound socket to not conflict sockets bound to an l3mdev given the
datapath isolation now guaranteed.

Signed-off-by: Robert Shearman <rshearma@vyatta.att-mail.com>
Signed-off-by: Mike Manning <mmanning@vyatta.att-mail.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/vrf.txt
include/net/inet6_hashtables.h
include/net/inet_hashtables.h
include/net/inet_sock.h
net/ipv4/inet_connection_sock.c
net/ipv4/inet_hashtables.c