Commit
07b45939972eb ("src: introduce struct nft_cache") added cache
pointer to struct netlink_mon_handler and the code assumes it is never
NULL. Therefore initialize it in the dummy version of
netlink_mon_handler in netlink_echo_callback().
Fixes: b99c4d072d996 ("Implement --echo option")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
int netlink_echo_callback(const struct nlmsghdr *nlh, void *data)
{
+ struct netlink_ctx *ctx = data;
struct netlink_mon_handler echo_monh = {
.format = NFTNL_OUTPUT_DEFAULT,
- .ctx = data,
+ .ctx = ctx,
.loc = &netlink_location,
.monitor_flags = 0xffffffff,
.cache_needed = true,
+ .cache = ctx->cache,
};
if (!echo_monh.ctx->octx->echo)