Fix error reporting when single device is specifies in chain: # nft add chain netdev filter ingress '{ devices = { x }; }' add chain netdev filter ingress { devices = { x }; } ^ Fixes: a66b5ad9540d ("src: allow for updating devices on existing netdev chain") Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> --- src/mnl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mnl.c b/src/mnl.c index 5dcfd9a04c4b..adc0bd3d61cf 100644 --- a/src/mnl.c +++ b/src/mnl.c @@ -790,6 +790,7 @@ static void mnl_nft_chain_devs_build(struct nlmsghdr *nlh, struct cmd *cmd) dev_array = nft_dev_array(dev_expr, &num_devs); if (num_devs == 1) { + cmd_add_loc(cmd, nlh->nlmsg_len, dev_array[0].location); mnl_attr_put_strz(nlh, NFTA_HOOK_DEV, dev_array[0].ifname); } else { nest_dev = mnl_attr_nest_start(nlh, NFTA_HOOK_DEVS); -- 2.30.2