Previously, error message was a bit misleading:
| # iptables-nft -Z noexist
| iptables: Incompatible with this kernel.
Set errno value so that the typical "No chain/target/match by that
name." is printed instead.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
if (chain) {
c = nftnl_chain_list_lookup_byname(list, chain);
- if (!c)
+ if (!c) {
+ errno = ENOENT;
return 0;
+ }
ret = __nft_chain_zero_counters(c, &d);
goto err;