From patchwork Sat Jan 11 12:07:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: FX Le Bail X-Patchwork-Id: 309506 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 88DF52C0078 for ; Sat, 11 Jan 2014 23:26:19 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752838AbaAKM0Q (ORCPT ); Sat, 11 Jan 2014 07:26:16 -0500 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:17373 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752292AbaAKM0P (ORCPT ); Sat, 11 Jan 2014 07:26:15 -0500 Received: from localhost.localdomain ([86.214.30.166]) by mwinf5d50 with ME id CcS41n0023b2xSm03cS85s; Sat, 11 Jan 2014 13:26:13 +0100 From: Francois-Xavier Le Bail To: netdev@vger.kernel.org Cc: Hannes Frederic Sowa , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki Yoshifuji , Patrick McHardy , Francois-Xavier Le Bail Subject: [PATCH net-next] IPv6: enable TCP to use an anycast address Date: Sat, 11 Jan 2014 13:07:39 +0100 Message-Id: <1389442059-3047-1-git-send-email-fx.lebail@yahoo.com> X-Mailer: git-send-email 1.7.10.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - Use ipv6_anycast_destination() in tcp_v6_send_reset() and tcp_v6_conn_request(). Signed-off-by: Francois-Xavier Le Bail --- Tested with link-local and global anycast addresses. Tested with SOCK_STREAM socket, bind and TCP traffic OK. net/ipv6/tcp_ipv6.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index ffd5fa8..85297b8 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -832,7 +832,8 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb) if (th->rst) return; - if (!ipv6_unicast_destination(skb)) + if (!ipv6_unicast_destination(skb) && + !ipv6_anycast_destination(skb)) return; #ifdef CONFIG_TCP_MD5SIG @@ -963,7 +964,8 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) if (skb->protocol == htons(ETH_P_IP)) return tcp_v4_conn_request(sk, skb); - if (!ipv6_unicast_destination(skb)) + if (!ipv6_unicast_destination(skb) && + !ipv6_anycast_destination(skb)) goto drop; if ((sysctl_tcp_syncookies == 2 ||