* [PATCH net-next] ipv6: Fix handling of LLA with VRF and sockets bound to VRF
@ 2018-12-12 23:27 David Ahern
2018-12-15 19:37 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2018-12-12 23:27 UTC (permalink / raw)
To: netdev; +Cc: davem, mmanning, sharpd, David Ahern
From: David Ahern <dsahern@gmail.com>
A recent commit allows sockets bound to a VRF to receive ipv6 link local
packets. However, it only works for UDP and worse TCP connection attempts
to the LLA with the only listener bound to the VRF just hang where as
before the client gets a reset and connection refused. Fix by adjusting
ir_iif for LL addresses and packets received through a device enslaved
to a VRF.
Fixes: 6f12fa775530 ("vrf: mark skb for multicast or link-local as enslaved to VRF")
Reported-by: Donald Sharp <sharpd@cumulusnetworks.com>
Cc: Mike Manning <mmanning@vyatta.att-mail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
---
net/ipv6/tcp_ipv6.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index a3f559162521..b81eb7cb815e 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -737,6 +737,7 @@ static void tcp_v6_init_req(struct request_sock *req,
const struct sock *sk_listener,
struct sk_buff *skb)
{
+ bool l3_slave = ipv6_l3mdev_skb(TCP_SKB_CB(skb)->header.h6.flags);
struct inet_request_sock *ireq = inet_rsk(req);
const struct ipv6_pinfo *np = inet6_sk(sk_listener);
@@ -744,7 +745,7 @@ static void tcp_v6_init_req(struct request_sock *req,
ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr;
/* So that link locals have meaning */
- if (!sk_listener->sk_bound_dev_if &&
+ if ((!sk_listener->sk_bound_dev_if || l3_slave) &&
ipv6_addr_type(&ireq->ir_v6_rmt_addr) & IPV6_ADDR_LINKLOCAL)
ireq->ir_iif = tcp_v6_iif(skb);
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] ipv6: Fix handling of LLA with VRF and sockets bound to VRF
2018-12-12 23:27 [PATCH net-next] ipv6: Fix handling of LLA with VRF and sockets bound to VRF David Ahern
@ 2018-12-15 19:37 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-12-15 19:37 UTC (permalink / raw)
To: dsahern; +Cc: netdev, mmanning, sharpd, dsahern
From: David Ahern <dsahern@kernel.org>
Date: Wed, 12 Dec 2018 15:27:38 -0800
> From: David Ahern <dsahern@gmail.com>
>
> A recent commit allows sockets bound to a VRF to receive ipv6 link local
> packets. However, it only works for UDP and worse TCP connection attempts
> to the LLA with the only listener bound to the VRF just hang where as
> before the client gets a reset and connection refused. Fix by adjusting
> ir_iif for LL addresses and packets received through a device enslaved
> to a VRF.
>
> Fixes: 6f12fa775530 ("vrf: mark skb for multicast or link-local as enslaved to VRF")
> Reported-by: Donald Sharp <sharpd@cumulusnetworks.com>
> Cc: Mike Manning <mmanning@vyatta.att-mail.com>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Applied, thanks David.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-15 19:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-12 23:27 [PATCH net-next] ipv6: Fix handling of LLA with VRF and sockets bound to VRF David Ahern
2018-12-15 19:37 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).