Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932307AbdIRQ3L (ORCPT ); Mon, 18 Sep 2017 12:29:11 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33606 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756169AbdIRQ3I (ORCPT ); Mon, 18 Sep 2017 12:29:08 -0400 X-Google-Smtp-Source: AOwi7QA8TxbvQQnM8H7VBhy9a9KrOzZk3nKucCauGFkdHhAyMuaol5WCh/fQSqwLjaFOSj/7UreKNA== From: josef@toxicpanda.com X-Google-Original-From: jbacik@fb.com To: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, crobinso@redhat.com, labbott@redhat.com, kernel-team@fb.com Cc: Josef Bacik , stable@vger.kernel.org Subject: [PATCH 2/3] net: use inet6_rcv_saddr to compare sockets Date: Mon, 18 Sep 2017 12:28:56 -0400 Message-Id: <1505752137-15522-3-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505752137-15522-1-git-send-email-jbacik@fb.com> References: <1505752137-15522-1-git-send-email-jbacik@fb.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1067 Lines: 29 From: Josef Bacik In ipv6_rcv_saddr_equal() we need to use inet6_rcv_saddr(sk) for the ipv6 compare with the fast socket information to make sure we're doing the proper comparisons. Cc: stable@vger.kernel.org Fixes: 637bc8bbe6c0 ("inet: reset tb->fastreuseport when adding a reuseport sk") Reported-and-tested-by: Cole Robinson Signed-off-by: Josef Bacik --- net/ipv4/inet_connection_sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index f87f4805e244..a1bf30438bc5 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c @@ -266,7 +266,7 @@ static inline int sk_reuseport_match(struct inet_bind_bucket *tb, #if IS_ENABLED(CONFIG_IPV6) if (tb->fast_sk_family == AF_INET6) return ipv6_rcv_saddr_equal(&tb->fast_v6_rcv_saddr, - &sk->sk_v6_rcv_saddr, + inet6_rcv_saddr(sk), tb->fast_rcv_saddr, sk->sk_rcv_saddr, tb->fast_ipv6_only, -- 2.7.4