From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josef Bacik Subject: Re: [PATCH] inet: don't use sk_v6_rcv_saddr directly Date: Fri, 20 Jan 2017 09:18:32 -0500 Message-ID: <1484921912.786.1@smtp.office365.com> References: <1484866066-25407-1-git-send-email-jbacik@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed To: , , , Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:57036 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752327AbdATPVl (ORCPT ); Fri, 20 Jan 2017 10:21:41 -0500 In-Reply-To: <1484866066-25407-1-git-send-email-jbacik@fb.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Jan 19, 2017 at 5:47 PM, Josef Bacik wrote: > When comparing two sockets we need to use inet6_rcv_saddr so we get a > NULL > sk_v6_rcv_saddr if the socket isn't AF_INET6, otherwise our > comparison function > can be wrong. > > Fixes: 637bc8b ("inet: reset tb->fastreuseport when adding a > reuseport sk") > 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 096a085..a336c42 100644 > --- a/net/ipv4/inet_connection_sock.c > +++ b/net/ipv4/inet_connection_sock.c > @@ -99,7 +99,7 @@ int inet_rcv_saddr_equal(const struct sock *sk, > const struct sock *sk2, > #if IS_ENABLED(CONFIG_IPV6) > if (sk->sk_family == AF_INET6) > return ipv6_rcv_saddr_equal(&sk->sk_v6_rcv_saddr, > - &sk2->sk_v6_rcv_saddr, > + inet6_rcv_saddr(sk2), > sk->sk_rcv_saddr, > sk2->sk_rcv_saddr, > ipv6_only_sock(sk), > -- > 2.5.5 Sorry I forgot to tag this, it's for net-next. Thanks, Josef