aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Gallek <kraig@google.com>2016-10-25 18:08:49 -0400
committerDavid S. Miller <davem@davemloft.net>2016-10-29 12:01:49 -0400
commite4cabca54911a6be6f2e80e48fa497c7e19019a5 (patch)
treeddb3bf47f45033bff0960019da9e937df6b06dc2
parent58a86c45866970ebc9c8cf99fabeb82457a959c6 (diff)
inet: Fix missing return value in inet6_hash
As part of a series to implement faster SO_REUSEPORT lookups, commit 086c653f5862 ("sock: struct proto hash function may error") added return values to protocol hash functions and commit 496611d7b5ea ("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: 496611d7b5ea ("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>
-rw-r--r--net/ipv6/inet6_hashtables.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index 2fd0374a35b1..02761c9fe43e 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -264,13 +264,15 @@ EXPORT_SYMBOL_GPL(inet6_hash_connect);
264 264
265int inet6_hash(struct sock *sk) 265int inet6_hash(struct sock *sk)
266{ 266{
267 int err = 0;
268
267 if (sk->sk_state != TCP_CLOSE) { 269 if (sk->sk_state != TCP_CLOSE) {
268 local_bh_disable(); 270 local_bh_disable();
269 __inet_hash(sk, NULL, ipv6_rcv_saddr_equal); 271 err = __inet_hash(sk, NULL, ipv6_rcv_saddr_equal);
270 local_bh_enable(); 272 local_bh_enable();
271 } 273 }
272 274
273 return 0; 275 return err;
274} 276}
275EXPORT_SYMBOL_GPL(inet6_hash); 277EXPORT_SYMBOL_GPL(inet6_hash);
276 278