netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>
Cc: netfilter-devel@vger.kernel.org, Derek Dai <daiderek@gmail.com>
Subject: Re: [nft PATCH] json: Fix seqnum_to_json() functionality
Date: Fri, 4 Dec 2020 11:37:02 +0100	[thread overview]
Message-ID: <20201204103702.GA27070@salvia> (raw)
In-Reply-To: <20201202222701.459-1-phil@nwl.cc>

On Wed, Dec 02, 2020 at 11:27:01PM +0100, Phil Sutter wrote:
> Introduction of json_cmd_assoc_hash missed that by the time the hash
> table insert happens, the struct cmd object's 'seqnum' field which is
> used as key is not initialized yet. This doesn't happen until
> nft_netlink() prepares the batch object which records the lowest seqnum.
> Therefore push all json_cmd_assoc objects into a temporary list until
> the first lookup happens. At this time, all referenced cmd objects have
> their seqnum set and the list entries can be moved into the hash table
> for fast lookups.
> 
> To expose such problems in the future, make json_events_cb() emit an
> error message if the passed message has a handle but no assoc entry is
> found for its seqnum.

Patch LGTM.

      reply	other threads:[~2020-12-04 10:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02 22:27 [nft PATCH] json: Fix seqnum_to_json() functionality Phil Sutter
2020-12-04 10:37 ` Pablo Neira Ayuso [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=20201204103702.GA27070@salvia \
    --to=pablo@netfilter.org \
    --cc=daiderek@gmail.com \
    --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 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).