Skip to content

Commit e4cabca

Browse files
kraigatgoogdavem330
authored andcommitted
inet: Fix missing return value in inet6_hash
As part of a series to implement faster SO_REUSEPORT lookups, commit 086c653 ("sock: struct proto hash function may error") added return values to protocol hash functions and commit 496611d ("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: 496611d ("inet: create IPv6-equivalent inet_hash function") Reported-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: Craig Gallek <kraig@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 58a86c4 commit e4cabca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/ipv6/inet6_hashtables.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,15 @@ EXPORT_SYMBOL_GPL(inet6_hash_connect);
264264

265265
int inet6_hash(struct sock *sk)
266266
{
267+
int err = 0;
268+
267269
if (sk->sk_state != TCP_CLOSE) {
268270
local_bh_disable();
269-
__inet_hash(sk, NULL, ipv6_rcv_saddr_equal);
271+
err = __inet_hash(sk, NULL, ipv6_rcv_saddr_equal);
270272
local_bh_enable();
271273
}
272274

273-
return 0;
275+
return err;
274276
}
275277
EXPORT_SYMBOL_GPL(inet6_hash);
276278

0 commit comments

Comments
 (0)