Commit 319554f2 authored by Josef Bacik's avatar Josef Bacik Committed by David S. Miller

inet: don't use sk_v6_rcv_saddr directly

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: 637bc8bb ("inet: reset tb->fastreuseport when adding a reuseport sk")
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7d982567
...@@ -99,7 +99,7 @@ int inet_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2, ...@@ -99,7 +99,7 @@ int inet_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2,
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
if (sk->sk_family == AF_INET6) if (sk->sk_family == AF_INET6)
return ipv6_rcv_saddr_equal(&sk->sk_v6_rcv_saddr, return ipv6_rcv_saddr_equal(&sk->sk_v6_rcv_saddr,
&sk2->sk_v6_rcv_saddr, inet6_rcv_saddr(sk2),
sk->sk_rcv_saddr, sk->sk_rcv_saddr,
sk2->sk_rcv_saddr, sk2->sk_rcv_saddr,
ipv6_only_sock(sk), ipv6_only_sock(sk),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment