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
Subject: Re: [libnftnl PATCH] src: Fix nftnl_assert() on data_len
Date: Fri, 14 Feb 2020 18:34:50 +0100	[thread overview]
Message-ID: <20200214173450.GR20005@orbyte.nwl.cc> (raw)
In-Reply-To: <20200214173247.2wbrvcqilqfmcqq5@salvia>

On Fri, Feb 14, 2020 at 06:32:47PM +0100, Pablo Neira Ayuso wrote:
> On Fri, Feb 14, 2020 at 06:24:17PM +0100, Phil Sutter wrote:
> > Typical idiom for *_get_u*() getters is to call *_get_data() and make
> > sure data_len matches what each of them is returning. Yet they shouldn't
> > trust *_get_data() to write into passed pointer to data_len since for
> > chains and NFTNL_CHAIN_DEVICES attribute, it does not. Make sure these
> > assert() calls trigger in those cases.
> 
> The intention to catch for unset attributes through the assertion,
> right?

No, this is about making sure that no wrong getter is called, e.g.
nftnl_chain_get_u64() with e.g. NFTNL_CHAIN_HOOKNUM attribute which is
only 32bits.

Cheers, Phil

  reply	other threads:[~2020-02-14 17:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 17:24 [libnftnl PATCH] src: Fix nftnl_assert() on data_len Phil Sutter
2020-02-14 17:32 ` Pablo Neira Ayuso
2020-02-14 17:34   ` Phil Sutter [this message]
2020-02-14 17:42     ` Pablo Neira Ayuso
2020-02-15  0:43       ` Phil Sutter
2020-02-15 13:17         ` Pablo Neira Ayuso
2020-02-15 22:58           ` Phil Sutter
2020-02-18 13:42             ` Pablo Neira Ayuso
2020-02-18 18:18               ` Phil Sutter
2020-02-18 21:06                 ` Pablo Neira Ayuso
2020-02-18 23:02                   ` Phil Sutter
2020-02-19  9:32                     ` Pablo Neira Ayuso

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=20200214173450.GR20005@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --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.