Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2220908/?format=api
{ "id": 2220908, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2220908/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260408115922.48676-5-pablo@netfilter.org/", "project": { "id": 26, "url": "http://patchwork.ozlabs.org/api/1.1/projects/26/?format=api", "name": "Netfilter Development", "link_name": "netfilter-devel", "list_id": "netfilter-devel.vger.kernel.org", "list_email": "netfilter-devel@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20260408115922.48676-5-pablo@netfilter.org>", "date": "2026-04-08T11:59:21", "name": "[nft,4/5] libnftables: use nft_eval_run_cmds() in nft_run_cmd_from_filename()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "bb693fb2408c6282a5a3b845f87c7f1af804f747", "submitter": { "id": 1315, "url": "http://patchwork.ozlabs.org/api/1.1/people/1315/?format=api", "name": "Pablo Neira Ayuso", "email": "pablo@netfilter.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260408115922.48676-5-pablo@netfilter.org/mbox/", "series": [ { "id": 499127, "url": "http://patchwork.ozlabs.org/api/1.1/series/499127/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=499127", "date": "2026-04-08T11:59:18", "name": "support for several list and reset commands", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499127/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2220908/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2220908/checks/", "tags": {}, "headers": { "Return-Path": "\n <netfilter-devel+bounces-11729-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "netfilter-devel@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=netfilter.org header.i=@netfilter.org\n header.a=rsa-sha256 header.s=2025 header.b=FZTprBf+;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11729-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org\n header.b=\"FZTprBf+\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=217.70.190.124", "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=netfilter.org", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=netfilter.org" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frM7r1Z5fz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 08 Apr 2026 22:00:08 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id BD05F302F733\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 8 Apr 2026 11:59:36 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 1B9C1364EB2;\n\tWed, 8 Apr 2026 11:59:36 +0000 (UTC)", "from mail.netfilter.org (mail.netfilter.org [217.70.190.124])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 66F823B95F9\n\tfor <netfilter-devel@vger.kernel.org>; Wed, 8 Apr 2026 11:59:34 +0000 (UTC)", "from localhost.localdomain (mail-agni [217.70.190.124])\n\tby mail.netfilter.org (Postfix) with ESMTPSA id 5DE706033E;\n\tWed, 8 Apr 2026 13:59:32 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775649575; cv=none;\n b=Jnb2xq2aXQeWnt/uKZvNIJPFuWkqGXvP0cRuMoZIsXdNzc8BqG2yJGBMkioReerb18MJ3atK4SWrWbJxbqv9jgT9fxyaie+0poBxHuEI79bGekOiaR9L11p8mLnMOMnZ0AuKM6636ykeUnrPzOn+GIHtFH+r6j5QU+R70d7tgx8=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775649575; c=relaxed/simple;\n\tbh=/uNecMsE5RmCjB517QwujTzEK/hrOz6YCdmztEHsnLM=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=P61TD1X6Ff40CgjWWVoCkMez1gQXBtdz0aYqnEnN/AYJFyUHVqsdjFLORdi9Mdru5FYgShTQB61AXxtZTJSjJJK2VJ+Z2YJF4MxrS8pJMgjYuTRFs7dyU2v1acD3qxG3sJ8Uo9NCtt4dtQPyDym+O9JgOddcTfVSJJ6+5uI8/jU=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=netfilter.org;\n spf=pass smtp.mailfrom=netfilter.org;\n dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org\n header.b=FZTprBf+; arc=none smtp.client-ip=217.70.190.124", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org;\n\ts=2025; t=1775649572;\n\tbh=K5g/Ny+u1Z5k6emKUFuLoeUV7U209dMuKQTFoNcWQ2U=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=FZTprBf+zNx4ftyhVPNhXmu2kCpQHBiiSNaem/fv8+xigPLpCBp9Rrt1kr2H8VYmk\n\t 0rLY1m8gL2Jt4Gs8vpHN7w8J4GGAW4Iu8UWz7CWayqlZaY9+Mq3+uZYeEVRCJSD06Q\n\t xXwxJlKrauatGSEMwU7U4ODlSWfoq8LuzxTpliMzEIIpVerrHHgntoFsCQJoMwNxE2\n\t YrOXby70ZcANvdh4Awh8Zo/cokuYtAUch2jGAXkXL9PvB/arwCp6MJ+rObydcPUXPf\n\t w6jy92rT1zLgs83BSYcUihdN93W2AOuNKNNhnh89VA3TT9Aggy++nbNFAy+C4GzzTB\n\t Z6IWw+GgyzVeA==", "From": "Pablo Neira Ayuso <pablo@netfilter.org>", "To": "netfilter-devel@vger.kernel.org", "Cc": "phil@nwl.cc,\n\tfw@strlen.de", "Subject": "[PATCH nft 4/5] libnftables: use nft_eval_run_cmds() in\n nft_run_cmd_from_filename()", "Date": "Wed, 8 Apr 2026 13:59:21 +0200", "Message-ID": "<20260408115922.48676-5-pablo@netfilter.org>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20260408115922.48676-1-pablo@netfilter.org>", "References": "<20260408115922.48676-1-pablo@netfilter.org>", "Precedence": "bulk", "X-Mailing-List": "netfilter-devel@vger.kernel.org", "List-Id": "<netfilter-devel.vger.kernel.org>", "List-Subscribe": "<mailto:netfilter-devel+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:netfilter-devel+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "Update nft_run_cmd_from_filename() to use this new helper function.\n\nMove err: tag to a later stage, which is run by the variables defined\nvia --define option, this should be safe.\n\nNo functional changes are intended, this comes in preparation to\nsupport several list/reset commands in a batch.\n\nSigned-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n---\n src/libnftables.c | 33 ++++-----------------------------\n 1 file changed, 4 insertions(+), 29 deletions(-)", "diff": "diff --git a/src/libnftables.c b/src/libnftables.c\nindex 5471ccf6f789..987f5d73ade4 100644\n--- a/src/libnftables.c\n+++ b/src/libnftables.c\n@@ -761,9 +761,9 @@ static struct error_record *filename_is_useable(struct nft_ctx *nft, const char\n static int __nft_run_cmd_from_filename(struct nft_ctx *nft, const char *filename)\n {\n \tstruct error_record *erec;\n-\tint rc, parser_rc;\n \tLIST_HEAD(msgs);\n \tLIST_HEAD(cmds);\n+\tint rc;\n \n \terec = filename_is_useable(nft, filename);\n \tif (erec) {\n@@ -782,35 +782,17 @@ static int __nft_run_cmd_from_filename(struct nft_ctx *nft, const char *filename\n \tif (rc == -EINVAL)\n \t\trc = nft_parse_bison_filename(nft, filename, &msgs, &cmds);\n \n-\tparser_rc = rc;\n-\n \tif (nft->optimize_flags)\n \t\tnft_optimize(nft, &cmds);\n \n-\trc = nft_evaluate(nft, &msgs, &cmds);\n-\tif (rc < 0) {\n-\t\tif (errno == EPERM) {\n-\t\t\tfprintf(stderr, \"%s (you must be root)\\n\",\n-\t\t\t\tstrerror(errno));\n-\t\t}\n-\t\tgoto err;\n-\t}\n-\n-\tif (parser_rc) {\n-\t\trc = parser_rc;\n-\t\tgoto err;\n-\t}\n-\n-\tif (nft_netlink(nft, &cmds, &msgs) != 0)\n-\t\trc = -1;\n-err:\n-\tnft_run_cmd_release(nft, &msgs, &cmds);\n+\trc = nft_eval_run_cmds(nft, &msgs, &cmds, rc);\n \n \tiface_cache_release();\n \tif (nft->scanner) {\n \t\tscanner_destroy(nft);\n \t\tnft->scanner = NULL;\n \t}\n+err:\n \tif (!list_empty(&nft->vars_ctx.indesc_list)) {\n \t\tstruct input_descriptor *indesc, *next;\n \n@@ -821,15 +803,8 @@ err:\n \t\t\tfree(indesc);\n \t\t}\n \t}\n-\tfree_const(nft->vars_ctx.buf);\n-\n-\tif (!rc &&\n-\t nft_output_json(&nft->output) &&\n-\t nft_output_echo(&nft->output))\n-\t\tjson_print_echo(nft);\n \n-\tif (rc || nft->check)\n-\t\tnft_cache_release(&nft->cache);\n+\tfree_const(nft->vars_ctx.buf);\n \n \tscope_release(nft->state->scopes[0]);\n \n", "prefixes": [ "nft", "4/5" ] }