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.