netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] inet: Fix missing return value in inet6_hash
@ 2016-10-25 22:08 Craig Gallek
  2016-10-25 22:36 ` Soheil Hassas Yeganeh
  2016-10-29 16:02 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Craig Gallek @ 2016-10-25 22:08 UTC (permalink / raw)
  To: David Miller; +Cc: Soheil Hassas Yeganeh, netdev

From: Craig Gallek <kraig@google.com>

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>
---
 net/ipv6/inet6_hashtables.c | 6 ++++--
 1 file 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);
 
 int inet6_hash(struct sock *sk)
 {
+	int err = 0;
+
 	if (sk->sk_state != TCP_CLOSE) {
 		local_bh_disable();
-		__inet_hash(sk, NULL, ipv6_rcv_saddr_equal);
+		err = __inet_hash(sk, NULL, ipv6_rcv_saddr_equal);
 		local_bh_enable();
 	}
 
-	return 0;
+	return err;
 }
 EXPORT_SYMBOL_GPL(inet6_hash);
 
-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] inet: Fix missing return value in inet6_hash
  2016-10-25 22:08 [PATCH net] inet: Fix missing return value in inet6_hash Craig Gallek
@ 2016-10-25 22:36 ` Soheil Hassas Yeganeh
  2016-10-29 16:02 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Soheil Hassas Yeganeh @ 2016-10-25 22:36 UTC (permalink / raw)
  To: Craig Gallek; +Cc: David Miller, netdev

On Tue, Oct 25, 2016 at 6:08 PM, Craig Gallek <kraigatgoog@gmail.com> wrote:
> From: Craig Gallek <kraig@google.com>
>
> 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>

> ---
>  net/ipv6/inet6_hashtables.c | 6 ++++--
>  1 file 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);
>
>  int inet6_hash(struct sock *sk)
>  {
> +       int err = 0;
> +
>         if (sk->sk_state != TCP_CLOSE) {
>                 local_bh_disable();
> -               __inet_hash(sk, NULL, ipv6_rcv_saddr_equal);
> +               err = __inet_hash(sk, NULL, ipv6_rcv_saddr_equal);
>                 local_bh_enable();
>         }
>
> -       return 0;
> +       return err;
>  }
>  EXPORT_SYMBOL_GPL(inet6_hash);

Thanks for the fix!

> --
> 2.8.0.rc3.226.g39d4020
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] inet: Fix missing return value in inet6_hash
  2016-10-25 22:08 [PATCH net] inet: Fix missing return value in inet6_hash Craig Gallek
  2016-10-25 22:36 ` Soheil Hassas Yeganeh
@ 2016-10-29 16:02 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-10-29 16:02 UTC (permalink / raw)
  To: kraigatgoog; +Cc: soheil, netdev

From: Craig Gallek <kraigatgoog@gmail.com>
Date: Tue, 25 Oct 2016 18:08:49 -0400

> From: Craig Gallek <kraig@google.com>
> 
> 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>

Applied and queued up for -stable, thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-29 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-25 22:08 [PATCH net] inet: Fix missing return value in inet6_hash Craig Gallek
2016-10-25 22:36 ` Soheil Hassas Yeganeh
2016-10-29 16:02 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).