All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, Florian Westphal <fw@strlen.de>
Subject: Re: [libnftnl PATCH] src/utils: Add a common dev_array parser
Date: Tue, 22 Oct 2024 15:17:54 +0200	[thread overview]
Message-ID: <ZxemApONbVWrFoQB@orbyte.nwl.cc> (raw)
In-Reply-To: <Zxejh_KRhd81uWSC@calendula>

On Tue, Oct 22, 2024 at 03:07:19PM +0200, Pablo Neira Ayuso wrote:
> On Wed, Oct 16, 2024 at 06:42:23PM +0200, Phil Sutter wrote:
> > Parsing of dev_array fields in flowtable and chain are identical, merge
> > them into a shared function nftnl_parse_devs() which does a quick scan
> > through the nested attributes to check validity and calculate required
> > array size instead of calling realloc() as needed.
> > 
> > This required to align structs nftnl_chain and nftnl_flowtable field
> > dev_array_len types, though uint32_t should match the size of int on
> > both 32 and 64 bit architectures.
> 
> Maybe go the extra mile and add an internal object for string arrays:
> 
> struct nftnl_str_array {
>         const char      **array;
>         uint32_t        len;
> };
> 
> and use it in chain and flowtable?

ACK, will do.

Thanks, Phil

      reply	other threads:[~2024-10-22 13:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16 16:42 [libnftnl PATCH] src/utils: Add a common dev_array parser Phil Sutter
2024-10-22 13:07 ` Pablo Neira Ayuso
2024-10-22 13:17   ` Phil Sutter [this message]

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=ZxemApONbVWrFoQB@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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 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.