From patchwork Tue Oct 25 22:08:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Craig Gallek X-Patchwork-Id: 686777 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3t3S3Z0v31z9sQw for ; Wed, 26 Oct 2016 09:08:58 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754126AbcJYWIy (ORCPT ); Tue, 25 Oct 2016 18:08:54 -0400 Received: from mail-qk0-f177.google.com ([209.85.220.177]:32919 "EHLO mail-qk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752476AbcJYWIx (ORCPT ); Tue, 25 Oct 2016 18:08:53 -0400 Received: by mail-qk0-f177.google.com with SMTP id n189so270026509qke.0 for ; Tue, 25 Oct 2016 15:08:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MI9gO3UP6/Byh3fw7694vUCYBYMbNFzYnaDeRoJz7RY=; b=lMSZLjNALbQw37KGreom1djSfuGuj9HCegIAlQtXxY/JpvkMEKdFfRkRpLkCjpTKaP ml3DdaKDAW8qcSde69J6Gm1F8CcsUDpvbaFYdpPUrYiPdz0CDRmLBAj2nXAOm1q4kxiZ 6Nme0XE7ZtsGdJjzG/On04JpklhZAbeMaKoXQ25eCp5LtAqDLM92gk2+j9Qxh+n8PiJR SuioHsDmBT9bnovXr18+tfsoo97tW6qVTjqJgtw/5LJvfkXyj7KECltHIftQzieJNgHf C9/Ft86pMf/noYhtc8+h10VUQubGE7PQIG6dOUyrQrBpIfm9z+Tlx9mSO1cuw5XA2BB9 gMlw== X-Gm-Message-State: ABUngvfmjvM1xrL90imN0EPbXpz/7lkkDPrxkuXFO8gcOA5hz4LRiNAH36wYKuwLO9EYN/Sq X-Received: by 10.55.221.29 with SMTP id n29mr24903690qki.114.1477433331956; Tue, 25 Oct 2016 15:08:51 -0700 (PDT) Received: from monkey.nyc.corp.google.com ([172.29.18.57]) by smtp.gmail.com with ESMTPSA id c2sm12143435qta.16.2016.10.25.15.08.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Oct 2016 15:08:50 -0700 (PDT) From: Craig Gallek To: David Miller Cc: Soheil Hassas Yeganeh , netdev@vger.kernel.org Subject: [PATCH net] inet: Fix missing return value in inet6_hash Date: Tue, 25 Oct 2016 18:08:49 -0400 Message-Id: <1477433329-165391-1-git-send-email-kraigatgoog@gmail.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Craig Gallek 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 Signed-off-by: Craig Gallek Acked-by: Soheil Hassas Yeganeh --- 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);