Just like legacy iptables, iptables-nft should not treat the attempt to
list a non-existing chain as OK.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
__nft_rule_list(h, chain_name, table,
rulenum, format, ops->print_rule);
+ found = true;
+
/* we printed the chain we wanted, stop processing. */
if (chain)
break;
- found = true;
-
next:
c = nftnl_chain_list_iter_next(iter);
}
nftnl_chain_list_iter_destroy(iter);
err:
+ if (chain && !found)
+ return 0;
+
return 1;
}