diff options
author | Phil Sutter <phil@nwl.cc> | 2020-12-02 23:07:11 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2020-12-04 12:28:57 +0100 |
commit | 299ec575faa6b070940b483dc517ecd883b9f1a4 (patch) | |
tree | 3045c4b590ed27ee34a075ff836ee043928ed885 /doc | |
parent | cb7e02f44d6a6fd1c6001e23cecb3d7534110617 (diff) |
json: Fix seqnum_to_json() functionality
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.
Fixes: 389a0e1edc89a ("json: echo: Speedup seqnum_to_json()")
Cc: Derek Dai <daiderek@gmail.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions