get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2220906/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2220906,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2220906/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260408115922.48676-4-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-4-pablo@netfilter.org>",
    "date": "2026-04-08T11:59:20",
    "name": "[nft,3/5] libnftables: consolidate evaluation and netlink run",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "72aad5ad259bf2f62c08f8da656e9e9b6050f3a9",
    "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-4-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/2220906/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2220906/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <netfilter-devel+bounces-11728-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=CWHO9b9J;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11728-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=\"CWHO9b9J\"",
            "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 [172.234.253.10])\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 4frM7d0YsPz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 08 Apr 2026 21:59:57 +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 306CA3038AFE\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Apr 2026 11:59:35 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id CFCD03B27F9;\n\tWed,  8 Apr 2026 11:59:34 +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 216C23BADBF\n\tfor <netfilter-devel@vger.kernel.org>; Wed,  8 Apr 2026 11:59:33 +0000 (UTC)",
            "from localhost.localdomain (mail-agni [217.70.190.124])\n\tby mail.netfilter.org (Postfix) with ESMTPSA id 7585E6033D;\n\tWed,  8 Apr 2026 13:59:31 +0200 (CEST)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775649574; cv=none;\n b=VehdguFrbOOByu4tTWXvOsfXKo+FbYpBas4f/29heSl+r2RHiCdTyEellpKWU7jXcUe9upuuwzKF2V995rJ3/6IV2+6/Y6oXt7kN46z96+/9K4T3ij5zuAmPLnRElBE8CDRSMtTAIP3V0Tb+DN2BN1dIhImWamFhXqyWa2kCA0Y=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775649574; c=relaxed/simple;\n\tbh=fDEXEB2kskSwuPvaSNC3rLfPdpCGJjEMiseheJHEVKY=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=UHX2lZQPQRsFXj2QsOgt9tTuhN15jwu75KUxwhoa2ixeiqeZGLtbKREiR1KAEMQ/EYujb/Q0aCnm2ItsrFcaBtcUMSelQ+3qVh5Lgi102JUUvCuaontXGmde01AW/d02V6Hirdc6Cw5WD393gokttiC0dXIdjnaJ8zzZdZI9JC0=",
        "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=CWHO9b9J; 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=1775649571;\n\tbh=N2s2UR1EWijMM2odnIthaVG0+z4aXJs2zb7F5psM3sE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=CWHO9b9Jx6RXVwVugKuYRRz+Hd7WgO85+qdaw9iPQxWoQ3u6U+VMX+W2EtYAksdFH\n\t qdDHpMIU9W8iw76MUJRe7q9AoN/Wnbud2zvWAy0dUd5pR+wcPHiOtQ5n4XoTASu6z1\n\t mrkZir8s6GKHF2AB4s1f/RYW2BWEfcKDKPtO4EezHjdjeibDVBRm5jVC5vAK7q5zw7\n\t zdZJHYMm1tOyGoSoJ/aKR1nMz7oO20ystgDewgQgGSF0MdHZzfnfIGbXVVPUXImt2b\n\t G+LT9LSVHpLH8/hKl1/ppKRkVRjAY3uL8/wO/bIoThcNDhMqgEPQSJknrivTbMtX1Y\n\t xGcSzKV41EYFw==",
        "From": "Pablo Neira Ayuso <pablo@netfilter.org>",
        "To": "netfilter-devel@vger.kernel.org",
        "Cc": "phil@nwl.cc,\n\tfw@strlen.de",
        "Subject": "[PATCH nft 3/5] libnftables: consolidate evaluation and netlink run",
        "Date": "Wed,  8 Apr 2026 13:59:20 +0200",
        "Message-ID": "<20260408115922.48676-4-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": "Add a helper function to wrap the code that evaluates the list of\ncommands and serialize them into the netlink batch.\n\nAdd a first user: nft_run_cmd_from_buffer(), there is a follow up patch\nwhich will do the same for nft_run_cmd_from_filename().\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 | 61 ++++++++++++++++++++++++++++-------------------\n 1 file changed, 37 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/src/libnftables.c b/src/libnftables.c\nindex 46d9c0df590b..5471ccf6f789 100644\n--- a/src/libnftables.c\n+++ b/src/libnftables.c\n@@ -618,22 +618,13 @@ static void nft_run_cmd_release(struct nft_ctx *nft,\n \t}\n }\n \n-EXPORT_SYMBOL(nft_run_cmd_from_buffer);\n-int nft_run_cmd_from_buffer(struct nft_ctx *nft, const char *buf)\n+static int nft_eval_run_cmds(struct nft_ctx *nft, struct list_head *msgs,\n+\t\t\t     struct list_head *cmds, int rc)\n {\n-\tint rc = -EINVAL, parser_rc;\n-\tLIST_HEAD(msgs);\n-\tLIST_HEAD(cmds);\n-\tchar *nlbuf;\n+\tint parser_rc;\n \n-\tnlbuf = xzalloc(strlen(buf) + 2);\n-\tsprintf(nlbuf, \"%s\\n\", buf);\n-\n-\tif (nft_output_json(&nft->output) || nft_input_json(&nft->input))\n-\t\trc = nft_parse_json_buffer(nft, nlbuf, &msgs, &cmds);\n-\tif (rc == -EINVAL)\n-\t\trc = nft_parse_bison_buffer(nft, nlbuf, &msgs, &cmds,\n-\t\t\t\t\t    &indesc_cmdline);\n+\tif (rc < 0)\n+\t\tgoto err;\n \n #if HAVE_FUZZER_BUILD\n \tif (nft->afl_ctx_stage == NFT_AFL_FUZZER_PARSER)\n@@ -641,7 +632,7 @@ int nft_run_cmd_from_buffer(struct nft_ctx *nft, const char *buf)\n #endif\n \tparser_rc = rc;\n \n-\trc = nft_evaluate(nft, &msgs, &cmds);\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@@ -655,17 +646,10 @@ int nft_run_cmd_from_buffer(struct nft_ctx *nft, const char *buf)\n \t\tgoto err;\n \t}\n \n-\tif (nft_netlink(nft, &cmds, &msgs) != 0)\n+\tif (nft_netlink(nft, cmds, msgs) != 0)\n \t\trc = -1;\n err:\n-\tnft_run_cmd_release(nft, &msgs, &cmds);\n-\n-\tiface_cache_release();\n-\tif (nft->scanner) {\n-\t\tscanner_destroy(nft);\n-\t\tnft->scanner = NULL;\n-\t}\n-\tfree(nlbuf);\n+\tnft_run_cmd_release(nft, msgs, cmds);\n \n \tif (!rc &&\n \t    nft_output_json(&nft->output) &&\n@@ -678,6 +662,35 @@ err:\n \treturn rc;\n }\n \n+EXPORT_SYMBOL(nft_run_cmd_from_buffer);\n+int nft_run_cmd_from_buffer(struct nft_ctx *nft, const char *buf)\n+{\n+\tint rc = -EINVAL;\n+\tLIST_HEAD(msgs);\n+\tLIST_HEAD(cmds);\n+\tchar *nlbuf;\n+\n+\tnlbuf = xzalloc(strlen(buf) + 2);\n+\tsprintf(nlbuf, \"%s\\n\", buf);\n+\n+\tif (nft_output_json(&nft->output) || nft_input_json(&nft->input))\n+\t\trc = nft_parse_json_buffer(nft, nlbuf, &msgs, &cmds);\n+\tif (rc == -EINVAL)\n+\t\trc = nft_parse_bison_buffer(nft, nlbuf, &msgs, &cmds,\n+\t\t\t\t\t    &indesc_cmdline);\n+\n+\trc = nft_eval_run_cmds(nft, &msgs, &cmds, rc);\n+\n+\tfree(nlbuf);\n+\tiface_cache_release();\n+\tif (nft->scanner) {\n+\t\tscanner_destroy(nft);\n+\t\tnft->scanner = NULL;\n+\t}\n+\n+\treturn rc;\n+}\n+\n static int load_cmdline_vars(struct nft_ctx *ctx, struct list_head *msgs)\n {\n \tunsigned int bufsize, ret, i, offset = 0;\n",
    "prefixes": [
        "nft",
        "3/5"
    ]
}