Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp780011rda; Sun, 22 Oct 2023 09:20:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFePcywQ/OIVxvzPMVoEHV1wjgVLDRqs3CeVNksJ/pxbJr4iL6bLOKt/C4uWTs99rYXLhx7 X-Received: by 2002:a17:903:644:b0:1c9:ca45:f86 with SMTP id kh4-20020a170903064400b001c9ca450f86mr6325753plb.18.1697991629703; Sun, 22 Oct 2023 09:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697991629; cv=none; d=google.com; s=arc-20160816; b=AceEmbqsaF4yJfF7MDK7MnEMK+gJlOx2ROEx1lEjeusrQYexTsIhnSvqE0gXav492i psWIlB+knH1yC4LC8HbWlsl92sX9+fozJTavqAWLt5UlrPsGuWhXn/yRHxAxNSy/tcaW VW5UcnAmvbdEwkUPcOM/dGN+nbJr8i6Thqd9pNAUrTaALUxhuHXuJWBrQWX+OZZL08z+ y0ncrtmixsQ0ipW3km0z4pLpQFl85qAt5spwsVUsw5z6dOC0moHfaJun4IBOAJHsURcd Vzc61w+ObnoElyxW0I3Nkwhg3Hi9QKKS7nQRUnK9SIucnP5+aaqRtdY2Tv0//qg8L29l ++4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=11Lp+yVZvF+OP07qRE75BniQsajVFgOyx716K7LaebY=; fh=GKuCftXWVuD2V02qa8+3+sB56hLITty73r2bEYgwwVo=; b=ji7hsvPFn4PLwISWB3ocCE2rRDSSh0YklIzpR2dJ5+GSfd2uAVVGm31D3Qw9JIAIo5 gWh0ye3KBD8R1HFL+sqz/f08RzPcjQUWGEMuvNU0FlpUTv1kV2cKEEdyO/5EVuHfQXWG m0nmBQFgQjooeO7imb2ZcxfnJ679eU2+5CWva1oqMDnFF3RZQoVS/u0hjLEUdZMpCZer M/DwvfDDwVEL2nzLcu7f5S+ijUhRCtXY7WCSID21uuiElftwl5w/UvBJ4lzggOH/aLKo uS58OphXMqXkLPwnjU3c49f8txgklDqantVlTuLY0w3oR4Q7bYUQy/hwtNAPiea4fRTS FZgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hW8QlV67; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bj11-20020a170902850b00b001c9de48fc85si5035474plb.179.2023.10.22.09.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 09:20:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hW8QlV67; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 87F628057435; Sun, 22 Oct 2023 09:20:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232456AbjJVQUR (ORCPT + 99 others); Sun, 22 Oct 2023 12:20:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232381AbjJVQUP (ORCPT ); Sun, 22 Oct 2023 12:20:15 -0400 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B6AD98; Sun, 22 Oct 2023 09:20:13 -0700 (PDT) Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-778940531dbso154238685a.0; Sun, 22 Oct 2023 09:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697991612; x=1698596412; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=11Lp+yVZvF+OP07qRE75BniQsajVFgOyx716K7LaebY=; b=hW8QlV67rumG7PpjyXs3gdlg824oNs6ZAKUFvC3nkIlZpdgjGwgZnvfogKapVJhuUV yY8pt/4KiembWGpsN7gvG6nMrYtmdzhKCQ9E0OMCp8ctdTHiOZBfXscif6x26h9KIDAw AXfDKRpK8HKIGMzZ50XDhmjGBWHh9lFzxpT9yJ/Tx4UZv+DeboaGoV3EcYspzcIVGHak yA1ba5q2pPsQGHPVw05fqPzjEM4vO/2qLYp8Ld7cXcro5jN2p3qQuPrdoGOMqgiuvqvl i7S3c3pxfe9jSvZZFcF7+YQsEBkJ5XM5SZiksmM47kVY5ShiPSM0e9FgnTL6Pm/SHSnh N52w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697991612; x=1698596412; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=11Lp+yVZvF+OP07qRE75BniQsajVFgOyx716K7LaebY=; b=duj3XTCn+stu8jZ7zKBF1d1WhQxEYyrBI8rwHLScqQsfTYc7i9CAtwCehJv80+YDU6 ab7pMkv+dgD17DEGehQy8+tQiWcVkZRVzzqquOl2nyStgHtNanwbjRvAKxnRb5/aROjT WMxoo6qNYBj0wmPBJFGG5Nj6J1aQUkA2b2D3yGmoyMIcDAPu5a3nbb1ydgs3vMDlCmxP 3Hd/PAnIQywk/w5yncwI81Mcu69SR7GeUZqXZGi8blQDxzqWvjRb8UyH6oaPaE24QdFX P+p8eP3Hq8ZOHHGR3f4P+MlJNUDMH7XuYGrvxrjSJkSOtBTG8udymNWKscxg6m0U1x/M 6G3w== X-Gm-Message-State: AOJu0Yx3rV6PFcDRc/UagbxQWoLDfYf8DAckuJ4yZM56KizsJObfU03k uJXwAmeAYqhCFIzovWyxhWmJRJtos3wtZDhc X-Received: by 2002:ad4:594d:0:b0:668:ecf4:d9b7 with SMTP id eo13-20020ad4594d000000b00668ecf4d9b7mr7255656qvb.8.1697991611838; Sun, 22 Oct 2023 09:20:11 -0700 (PDT) Received: from localhost ([2601:8c:502:14f0:d6de:9959:3c29:509b]) by smtp.gmail.com with ESMTPSA id g19-20020ad457b3000000b0066cfbe4e0f4sm2243863qvx.26.2023.10.22.09.20.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 09:20:11 -0700 (PDT) Date: Sun, 22 Oct 2023 12:20:10 -0400 From: Oliver Crumrine To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: davem@davemloft.n Subject: [PATCH net-next 02/17] Allocate and free cork for ipv4 and ipv6 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 22 Oct 2023 09:20:27 -0700 (PDT) This allocates the cork for ipv4, and frees it for both ipv4 and ipv6 (ipv6 inet_cork_full is allocated in a different function) Signed-off-by: Oliver Crumrine --- net/ipv4/af_inet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 2713c9b06c4c..3edfd8737715 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -362,6 +362,7 @@ static int inet_create(struct net *net, struct socket *sock, int protocol, inet->mc_index = 0; inet->mc_list = NULL; inet->rcv_tos = 0; + inet->cork = kzalloc(sizeof(struct inet_cork_full), GFP_KERNEL); if (inet->inet_num) { /* It assumes that any protocol which allows @@ -431,6 +432,7 @@ int inet_release(struct socket *sock) !(current->flags & PF_EXITING)) timeout = sk->sk_lingertime; sk->sk_prot->close(sk, timeout); + kfree(inet_sk(sk)->cork); sock->sk = NULL; } return 0; -- 2.42.0