Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4554665imm; Mon, 17 Sep 2018 16:27:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbgMsRhqW6kCoNsaoDWM3nzqrjrkHU75uv0sPc3eq5P6RZ4kcQLLG+ssUB0VNiIu/xOtybV X-Received: by 2002:a62:411a:: with SMTP id o26-v6mr28165719pfa.111.1537226822244; Mon, 17 Sep 2018 16:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537226822; cv=none; d=google.com; s=arc-20160816; b=J8pfCsP97znAKMdLeGpCUVXsDTZGbnScwwrHGkoem7naXk2juiQiS4VjUMxoVC+qqM z2EbVL8BC7F73LcjuXnNmsO49QGRpcWt24OgEppAwuvSFBLVC6krteCKwF5pfOl1d6Wp 9tBdaMRuBBsjrJ57/Sl9ou4Wg6m/2Ts982/yogXr7sid4NYrH8UERGxHzHpwK9q0KOBb MxHU/KRtR/vSY+3nqPVbfs98/c8DSam6H9nTICzEJxNWHRe3HxO/pCf3fFnEhRuyv8iz MNmZVSV+WR5ztN0XJBTTJC7CSjSxNTNtWk7qHI5GQabXTZRw6C7QSLA0+Ih6Y8x3V2HS Bk8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=u7sNBntnjQF0JxhfHkpjv2ruCHRFc0oTY8j/dfroAlo=; b=Z28UqTnRgooi1KL4j05ucKYXHXzj2hPHeO5sbW+u/funUb/fFA7xGPh4ZIC6bseFMS Gj+CecFdfv+MoqIHeNx9R+8LS73AMyoatt0vO40ebkfUxPc52vykHro/sCNJCC8iiNdp iwpNklvA4meGhnE5AhmxSIArHqLnne4MDCrp/1BG4fVK/eb8fOWvtxh0VLxnJaKoSUST dQF/tQ6hImtaYiMANbC8d1Z2KLhziRf7IxkHq5JCBBnFvY70m62uXiiqmZgQPL7PZtE2 HFFhgOoeE9UMAHe6QmdljLyqVxqXMJagttDg9oXbXK+0j3+7EA3XlbHR2TDpI22ck87P vywA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8-v6si16028911pfm.141.2018.09.17.16.26.46; Mon, 17 Sep 2018 16:27:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730890AbeIREeO (ORCPT + 99 others); Tue, 18 Sep 2018 00:34:14 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49194 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727202AbeIREeN (ORCPT ); Tue, 18 Sep 2018 00:34:13 -0400 Received: from localhost (li1825-44.members.linode.com [172.104.248.44]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A330EC03; Mon, 17 Sep 2018 23:04:43 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , "David S. Miller" Subject: [PATCH 4.14 096/126] inet: frags: refactor ipv6_frag_init() Date: Tue, 18 Sep 2018 00:42:24 +0200 Message-Id: <20180917211710.240608367@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180917211703.481236999@linuxfoundation.org> References: <20180917211703.481236999@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet We want to call inet_frags_init() earlier. This is a prereq to "inet: frags: use rhashtables for reassembly units" Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller (cherry picked from commit 5b975bab23615cd0fdf67af6c9298eb01c4b9f61) Signed-off-by: Greg Kroah-Hartman --- net/ipv6/reassembly.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -746,10 +746,21 @@ int __init ipv6_frag_init(void) { int ret; - ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT); + ip6_frags.hashfn = ip6_hashfn; + ip6_frags.constructor = ip6_frag_init; + ip6_frags.destructor = NULL; + ip6_frags.qsize = sizeof(struct frag_queue); + ip6_frags.match = ip6_frag_match; + ip6_frags.frag_expire = ip6_frag_expire; + ip6_frags.frags_cache_name = ip6_frag_cache_name; + ret = inet_frags_init(&ip6_frags); if (ret) goto out; + ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT); + if (ret) + goto err_protocol; + ret = ip6_frags_sysctl_register(); if (ret) goto err_sysctl; @@ -758,16 +769,6 @@ int __init ipv6_frag_init(void) if (ret) goto err_pernet; - ip6_frags.hashfn = ip6_hashfn; - ip6_frags.constructor = ip6_frag_init; - ip6_frags.destructor = NULL; - ip6_frags.qsize = sizeof(struct frag_queue); - ip6_frags.match = ip6_frag_match; - ip6_frags.frag_expire = ip6_frag_expire; - ip6_frags.frags_cache_name = ip6_frag_cache_name; - ret = inet_frags_init(&ip6_frags); - if (ret) - goto err_pernet; out: return ret; @@ -775,6 +776,8 @@ err_pernet: ip6_frags_sysctl_unregister(); err_sysctl: inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT); +err_protocol: + inet_frags_fini(&ip6_frags); goto out; }