Linux Netfilter development
 help / color / mirror / Atom feed
* [PATCH nft] mnl: incomplete extended error reporting for singleton device in chain
@ 2023-04-25 14:54 Pablo Neira Ayuso
  0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2023-04-25 14:54 UTC (permalink / raw)
  To: netfilter-devel

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@netfilter.org>
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-25 14:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 14:54 [PATCH nft] mnl: incomplete extended error reporting for singleton device in chain Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox