From: Phil Sutter <phil@nwl.cc>
To: Alexandre Knecht <knecht.alexandre@gmail.com>
Cc: netfilter-devel@vger.kernel.org, fw@strlen.de
Subject: Re: [PATCH v5 1/3] parser_json: support handle for rule positioning in explicit JSON format
Date: Tue, 20 Jan 2026 15:56:49 +0100 [thread overview]
Message-ID: <aW-XscWfRRhMJaUh@orbyte.nwl.cc> (raw)
In-Reply-To: <CAHAB8WzhVzdiSQ47Pf79A-3O9F3cHek6euq=vWEP1rMcpbuixA@mail.gmail.com>
Hi Alexandre,
On Tue, Jan 20, 2026 at 03:27:58PM +0100, Alexandre Knecht wrote:
> Hi Phil,
>
> Thanks for the comment, that's pretty straightforward to fix, I'm
> afraid to do a lot of spamming if I post again a new series, so can
> you confirm this is what you expect ?
>
> Merged nested if-conditionals (cheap to expensive):
> - if (!(ctx->flags & CTX_F_IMPLICIT) &&
> - !json_unpack(root, "{s:I}", "handle", &h.handle.id)) {
> - if (op == CMD_INSERT || op == CMD_ADD || op == CMD_CREATE) {
> - h.position.id = h.handle.id;
> - h.handle.id = 0;
> - }
> - }
> + if (!(ctx->flags & CTX_F_IMPLICIT) &&
> + (op == CMD_INSERT || op == CMD_ADD || op == CMD_CREATE) &&
> + !json_unpack(root, "{s:I}", "handle", &h.handle.id)) {
> + h.position.id = h.handle.id;
> + h.handle.id = 0;
> + }
Yes, this looks correct!
> Reverse Christmas Tree variable declarations:
> - unsigned int i;
> - json_t *tmp;
> uint32_t old_flags;
> struct cmd *cmd;
> + unsigned int i;
> + json_t *tmp;
Also correct AFAICT.
> Or maybe there's a solution to amend this series, not kinda used to
> work with git send-email, so if I can resubmit without a new whole
> series, could be good ! Otherwise, I'll just create a new one once you
> confirm.
I can apply trivial changes to patches when applying them. With some
projects, people also just resubmit parts of the series - this causes a
bit of a mess for maintainers (and reviewers) though so it's not usually
done. With a small series like this, I would just resubmit the whole
thing. After all, becoming more familiar with git-send-email and the
whole process of amending changes and submitting a new version is very
good practice for contributing to OSS projects! And please don't forget,
we're here to help if you get stuck or don't know how to get started
with something.
> Maybe I'll wait for review on tests too before submitting everything again.
Just finished, only one more change in second patch requested.
Thanks, Phil
next prev parent reply other threads:[~2026-01-20 14:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-19 14:08 [PATCH v5 0/3] parser_json: support handle for rule positioning Alexandre Knecht
2026-01-19 14:08 ` [PATCH v5 1/3] parser_json: support handle for rule positioning in explicit JSON format Alexandre Knecht
2026-01-20 14:08 ` Phil Sutter
2026-01-20 14:27 ` Alexandre Knecht
2026-01-20 14:56 ` Phil Sutter [this message]
2026-01-19 14:08 ` [PATCH v5 2/3] tests: shell: add JSON test for all object types Alexandre Knecht
2026-01-20 14:39 ` Phil Sutter
2026-01-19 14:08 ` [PATCH v5 3/3] tests: shell: add JSON test for handle-based rule positioning Alexandre Knecht
2026-01-20 14:46 ` Phil Sutter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aW-XscWfRRhMJaUh@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=fw@strlen.de \
--cc=knecht.alexandre@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox