Commit e4cabca5 authored by Craig Gallek's avatar Craig Gallek Committed by David S. Miller

inet: Fix missing return value in inet6_hash

As part of a series to implement faster SO_REUSEPORT lookups,
commit 086c653f ("sock: struct proto hash function may error")
added return values to protocol hash functions and
commit 496611d7 ("inet: create IPv6-equivalent inet_hash function")
implemented a new hash function for IPv6.  However, the latter does
not respect the former's convention.

This properly propagates the hash errors in the IPv6 case.

Fixes: 496611d7 ("inet: create IPv6-equivalent inet_hash function")
Reported-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: default avatarCraig Gallek <kraig@google.com>
Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58a86c45
...@@ -264,13 +264,15 @@ EXPORT_SYMBOL_GPL(inet6_hash_connect); ...@@ -264,13 +264,15 @@ EXPORT_SYMBOL_GPL(inet6_hash_connect);
int inet6_hash(struct sock *sk) int inet6_hash(struct sock *sk)
{ {
int err = 0;
if (sk->sk_state != TCP_CLOSE) { if (sk->sk_state != TCP_CLOSE) {
local_bh_disable(); local_bh_disable();
__inet_hash(sk, NULL, ipv6_rcv_saddr_equal); err = __inet_hash(sk, NULL, ipv6_rcv_saddr_equal);
local_bh_enable(); local_bh_enable();
} }
return 0; return err;
} }
EXPORT_SYMBOL_GPL(inet6_hash); EXPORT_SYMBOL_GPL(inet6_hash);
......
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