Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2231696/?format=api
{ "id": 2231696, "url": "http://patchwork.ozlabs.org/api/patches/2231696/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260501063156.2520780-2-rc@rexion.ai/", "project": { "id": 26, "url": "http://patchwork.ozlabs.org/api/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, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260501063156.2520780-2-rc@rexion.ai>", "list_archive_url": null, "date": "2026-05-01T06:31:54", "name": "[net-next,v2,1/3] netfilter: conntrack: add shared port parser for helpers", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f6ce974cd4bf4cad33e7ddb939c091bcab113d99", "submitter": { "id": 93293, "url": "http://patchwork.ozlabs.org/api/people/93293/?format=api", "name": "HACKE-RC", "email": "rc@rexion.ai" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260501063156.2520780-2-rc@rexion.ai/mbox/", "series": [ { "id": 502426, "url": "http://patchwork.ozlabs.org/api/series/502426/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=502426", "date": "2026-05-01T06:31:53", "name": "netfilter: conntrack: add shared port parser and use it in IRC and Amanda helpers", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/502426/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2231696/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2231696/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <netfilter-devel+bounces-12365-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=fail reason=\"key not found in DNS\" header.d=rexion.ai\n header.i=@rexion.ai header.a=rsa-sha256 header.s=spacemail header.b=ge14SECc;\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-12365-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key) header.d=rexion.ai\n header.i=@rexion.ai header.b=\"ge14SECc\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=66.29.159.77", "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=rexion.ai", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=rexion.ai" ], "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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g6Lnz5hKrz1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 16:33:11 +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 419693028ED2\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 1 May 2026 06:32:19 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6576A35E949;\n\tFri, 1 May 2026 06:32:18 +0000 (UTC)", "from out-06.smtp.spacemail.com (out-06.smtp.spacemail.com\n [66.29.159.77])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id BA6BF231835;\n\tFri, 1 May 2026 06:32:16 +0000 (UTC)", "from Kyren (unknown [49.207.224.37])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby mail.spacemail.com (Postfix) with ESMTPSA id 4g6Lmq2CCHz8sX2;\n\tFri, 01 May 2026 06:32:11 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777617138; cv=none;\n b=awEF+VTfeN7gYoe1K8OC4r+XOD0vMfc2MZQVfcUIj1s5fEu2vhL6c0dgWP7xOEOu8bErWr1KJ39b+BO689esqxk4equMTqQkIWTrrmQbA/h7v+l9o9MpNZtjaWhQkO9btJROOtZVpHoTriHEwNSnRdKAjrZazq5kqC+hF7OKbCA=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777617138; c=relaxed/simple;\n\tbh=AQd2sw1EZKQtxF/RoAKXgzvPNwc2JS7cbKhPcFoLW+I=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=tfiqEHRazlRaoFpXeJihL7vx0irn7tD0KujIokhOKJCfuuC2E+KN6Fr9Vi8q0HAz74Hi5zKrOiXO93+Sp7If4yFSxXveFyXbqOVOCGfvaayu75Sqy1XV5P/oapigQefqK1KCVUB14AY4eIVkTCa21f4/h+44qifEn2bR2n7dZqc=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=rexion.ai;\n spf=pass smtp.mailfrom=rexion.ai;\n dkim=fail (0-bit key) header.d=rexion.ai header.i=@rexion.ai\n header.b=ge14SECc reason=\"key not found in DNS\";\n arc=none smtp.client-ip=66.29.159.77", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=rexion.ai;\n\ts=spacemail; t=1777617135;\n\tbh=ykvFs84X9ifnNLgl1nKjZZCGpsIMTr1LlOqri6Q6e/A=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ge14SECc/2b+qcGuGlmiqa+I7WmH5Lm3VGj4K+f8oNo4Pu06xlYq+Fn3l43ndfQOd\n\t zVbJqfPX4Q/Do7qT6NFFrA5kM9XV8FVi/cmhAlgycDQzyb25zMO+MHa6yEzFkiz63Z\n\t sKCHTCPpLqBlz+7okFx5RnTE618hUNbzVTvxEZhLH0atCo3acsoNYXKS9Ax+pQ7JYh\n\t DM0GR+SvuRX7JyK64tXcSuqH7/EIhw5qIfpiLVI4TI82K2ylgzCkhsexDCCZN4LaiA\n\t p2Ap3W8WILphjPzCPWORGXix9CNuuqJ1GR6G+8NAbJHsW/RfVxxsBkfWnpsjFWoYrw\n\t QOtnkNBSUBWAg==", "From": "HACKE-RC <rc@rexion.ai>", "To": "Pablo Neira Ayuso <pablo@netfilter.org>,\n\tFlorian Westphal <fw@strlen.de>", "Cc": "Phil Sutter <phil@nwl.cc>,\n\t\"David S . Miller\" <davem@davemloft.net>,\n\tEric Dumazet <edumazet@google.com>,\n\tJakub Kicinski <kuba@kernel.org>,\n\tPaolo Abeni <pabeni@redhat.com>,\n\tSimon Horman <horms@kernel.org>,\n\tnetfilter-devel@vger.kernel.org,\n\tcoreteam@netfilter.org,\n\tnetdev@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tHACKE-RC <rc@rexion.ai>", "Subject": "[PATCH net-next v2 1/3] netfilter: conntrack: add shared port parser\n for helpers", "Date": "Fri, 1 May 2026 12:01:54 +0530", "Message-ID": "<20260501063156.2520780-2-rc@rexion.ai>", "X-Mailer": "git-send-email 2.54.0", "In-Reply-To": "<20260501063156.2520780-1-rc@rexion.ai>", "References": "<20260501063156.2520780-1-rc@rexion.ai>", "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", "X-Envelope-From": "rc@rexion.ai" }, "content": "Add nf_ct_helper_parse_port() to the conntrack helper core. This\nprovides a port parser that does not rely on nul-terminated strings,\ntaking an explicit length parameter and validating the result fits\nin the 1-65535 range.\n\nModeled after the approach in 8cf6809cddcb (\"netfilter:\nnf_conntrack_sip: don't use simple_strtoul\") but as a shared\nfunction so IRC, Amanda, and other helpers can use it instead of\nopen-coding simple_strtoul calls with ad-hoc range checks.\n\nSigned-off-by: HACKE-RC <rc@rexion.ai>\n---\n include/net/netfilter/nf_conntrack_helper.h | 3 +++\n net/netfilter/nf_conntrack_helper.c | 28 +++++++++++++++++++++\n 2 files changed, 31 insertions(+)", "diff": "diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h\nindex de2f956ab..db19fe25f 100644\n--- a/include/net/netfilter/nf_conntrack_helper.h\n+++ b/include/net/netfilter/nf_conntrack_helper.h\n@@ -160,6 +160,9 @@ nf_ct_helper_expectfn_find_by_name(const char *name);\n struct nf_ct_helper_expectfn *\n nf_ct_helper_expectfn_find_by_symbol(const void *symbol);\n \n+int nf_ct_helper_parse_port(const char *cp, unsigned int len,\n+\t\t\t u16 *port, char **endp);\n+\n extern struct hlist_head *nf_ct_helper_hash;\n extern unsigned int nf_ct_helper_hsize;\n \ndiff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c\nindex a715304a5..12f51670d 100644\n--- a/net/netfilter/nf_conntrack_helper.c\n+++ b/net/netfilter/nf_conntrack_helper.c\n@@ -499,6 +499,34 @@ void nf_nat_helper_unregister(struct nf_conntrack_nat_helper *nat)\n }\n EXPORT_SYMBOL_GPL(nf_nat_helper_unregister);\n \n+int nf_ct_helper_parse_port(const char *cp, unsigned int len,\n+\t\t\t u16 *port, char **endp)\n+{\n+\tunsigned long result = 0;\n+\tconst char *start = cp;\n+\n+\twhile (len > 0 && *cp >= '0' && *cp <= '9') {\n+\t\tresult = result * 10 + (*cp - '0');\n+\t\tif (result > 65535)\n+\t\t\treturn -1;\n+\t\tcp++;\n+\t\tlen--;\n+\t}\n+\n+\tif (cp == start)\n+\t\treturn -1;\n+\n+\tif (result == 0)\n+\t\treturn -1;\n+\n+\t*port = result;\n+\tif (endp)\n+\t\t*endp = (char *)cp;\n+\n+\treturn 0;\n+}\n+EXPORT_SYMBOL_GPL(nf_ct_helper_parse_port);\n+\n int nf_conntrack_helper_init(void)\n {\n \tnf_ct_helper_hsize = 1; /* gets rounded up to use one page */\n", "prefixes": [ "net-next", "v2", "1/3" ] }