netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Haller <thaller@redhat.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: NetFilter <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH nft 2/2] netlink: add and use _nftnl_udata_buf_alloc() helper
Date: Thu, 09 Nov 2023 17:48:57 +0100	[thread overview]
Message-ID: <a81dc3f30da3055116ded96a2f4ad423e4ba7899.camel@redhat.com> (raw)
In-Reply-To: <ZUz7my1Gawv5RSb4@calendula>

On Thu, 2023-11-09 at 16:32 +0100, Pablo Neira Ayuso wrote:
> On Thu, Nov 09, 2023 at 04:19:29PM +0100, Thomas Haller wrote:
> > On Thu, 2023-11-09 at 16:14 +0100, Pablo Neira Ayuso wrote:
> > > 
> > > Add a wrapper function, no macro.
> > > 
> > 
> > 
> > memory_allocation_error() is itself a macro, as it uses
> > __FILE__,__LINE__
> 
> In this case above, __FILE__ and __LINE__ does not provide much
> information?

In which case? The patch changes a repeated pattern to a macro(),
without changing any behavior and without questioning the use of
__FILE__:__LINE__.
.

> nftnl_expr_alloc() returns NULL when support for an expression is
> missing in libnftnl,

The patch is not about nftnl_expr_alloc(). Do you mean
nftnl_udata_buf_alloc()?

nftnl_udata_buf_alloc() fails exactly when malloc() fails. It's
unrelated to missing "support for an expression".

>  that provides a hint on that, this is very rare
> and it can only happen when developing support for new expressions.
> 
> Maybe simply say __func__ instead to know what function has failed
> when performing the memory allocation is a hint that is fine enough.

I wouldn't use __func__. It consumes more strings in the binary while
providing less exact information.


Thomas


  reply	other threads:[~2023-11-09 16:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08 18:24 [PATCH nft 1/2] utils: add memory_allocation_check() helper Thomas Haller
2023-11-08 18:24 ` [PATCH nft 2/2] netlink: add and use _nftnl_udata_buf_alloc() helper Thomas Haller
2023-11-09 15:14   ` Pablo Neira Ayuso
2023-11-09 15:19     ` Thomas Haller
2023-11-09 15:32       ` Pablo Neira Ayuso
2023-11-09 16:48         ` Thomas Haller [this message]
2023-11-09 19:12           ` Pablo Neira Ayuso
2023-11-09 15:24 ` [PATCH nft 1/2] utils: add memory_allocation_check() helper Pablo Neira Ayuso
2023-11-09 17:02   ` Thomas Haller
2023-11-15  8:52     ` Florian Westphal
2023-11-15  9:06       ` Thomas Haller

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=a81dc3f30da3055116ded96a2f4ad423e4ba7899.camel@redhat.com \
    --to=thaller@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).