https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-3.18.y&id=a360eb6f74b999a7546f2542c0d6483fdbb73461 Give preference to Linux-Vserver patch over upstream IPv4-mapped-to-IPv6 fix. The upstream fix is only relevant for IPv6 loopback (ie mapping destination of :: to ::ffff:127.0.0.1 or ::1 based on whether source is IPv4-mapped IPv6 address), which Linux-Vserver doesn't specifically support (eg VSERVER_AUTO_LBACK is IPv4-only). See https://lwn.net/Articles/688462/, section "Address mapping", for more information on IPv4-mapped IPv6. If socket has a Linux-Vserver network context, then handle as previous, otherwise handle as per the upstream fix. diff -urNp a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c --- a/net/ipv6/tcp_ipv6.c 2017-07-21 09:49:54.073001106 -0500 +++ b/net/ipv6/tcp_ipv6.c 2017-07-21 09:55:43.805534787 -0500 @@ -166,11 +166,17 @@ static int tcp_v6_connect(struct sock *s */ if (ipv6_addr_any(&usin->sin6_addr)) { - if (ipv6_addr_v4mapped(&sk->sk_v6_rcv_saddr)) - ipv6_addr_set_v4mapped(htonl(INADDR_LOOPBACK), - &usin->sin6_addr); + struct nx_info *nxi = sk->sk_nx_info; + + if (nxi && nx_info_has_v6(nxi)) + /* FIXME: remap lback? */ + usin->sin6_addr = nxi->v6.ip; else - usin->sin6_addr = in6addr_loopback; + if (ipv6_addr_v4mapped(&sk->sk_v6_rcv_saddr)) + ipv6_addr_set_v4mapped(htonl(INADDR_LOOPBACK), + &usin->sin6_addr); + else + usin->sin6_addr = in6addr_loopback; } addr_type = ipv6_addr_type(&usin->sin6_addr);