From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: Phil Sutter <phil@nwl.cc>, netfilter-devel@vger.kernel.org
Subject: Re: [libnftnl PATCH] utils: Introduce nftnl_parse_str_attr()
Date: Thu, 16 Oct 2025 15:52:26 +0200 [thread overview]
Message-ID: <aPD4mgdtY4DjLrEH@calendula> (raw)
In-Reply-To: <aPDQljEef_EXGmFy@strlen.de>
On Thu, Oct 16, 2025 at 01:01:42PM +0200, Florian Westphal wrote:
> Phil Sutter <phil@nwl.cc> wrote:
> > Wrap the common parsing of string attributes into a function. Apart from
> > slightly reducing code size, this unifies callers in conditional freeing
> > of the field in case it was set before (missing in twelve spots) and
> > error checking for failing strdup()-calls (missing in four spots).
> > Signed-off-by: Phil Sutter <phil@nwl.cc>
> > ---
> > include/utils.h | 3 +++
> > src/chain.c | 33 +++++++++------------------------
> > src/expr/dynset.c | 12 +++++-------
> > src/expr/flow_offload.c | 12 +++++-------
> > src/expr/log.c | 13 ++++---------
> > src/expr/lookup.c | 12 +++++-------
> > src/expr/objref.c | 18 ++++++++----------
> > src/flowtable.c | 24 ++++++++----------------
> > src/object.c | 14 ++++++--------
> > src/rule.c | 22 ++++++----------------
> > src/set.c | 22 ++++++----------------
> > src/set_elem.c | 38 +++++++++++++-------------------------
> > src/table.c | 11 +++--------
> > src/trace.c | 28 ++++++++++------------------
> > src/utils.c | 15 +++++++++++++++
> > 15 files changed, 106 insertions(+), 171 deletions(-)
>
> Nice compaction.
>
> Acked-by: Florian Westphal <fw@strlen.de>
I started different infrastructure to compact this, I can rebase at
some point on top this if Phil is having time to make cleanups.
next prev parent reply other threads:[~2025-10-16 13:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 20:24 [libnftnl PATCH] utils: Introduce nftnl_parse_str_attr() Phil Sutter
2025-10-16 11:01 ` Florian Westphal
2025-10-16 13:52 ` Pablo Neira Ayuso [this message]
2025-10-16 14:03 ` Phil Sutter
2025-10-18 19:13 ` 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=aPD4mgdtY4DjLrEH@calendula \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.