summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-12-15 19:25:04 +0100
committerFlorian Westphal <fw@strlen.de>2019-02-01 15:46:39 +0100
commit4c54c892443c20a1d0e1212d541da0e81647058a (patch)
treeebb6898d88fb7f496dc03067400af2845cc18057
parent3d8f261c565a024c13d627b18a0fcafc76de8f2c (diff)
xtables: Catch errors when zeroing rule rounters
Covscan complained about call to batch_rule_add() not being checked. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r--iptables/nft.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/iptables/nft.c b/iptables/nft.c
index 2fa973cf..8d0d1017 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -2991,7 +2991,9 @@ static int __nft_chain_zero_counters(struct nftnl_chain *c, void *data)
* rule based on its handle only.
*/
nftnl_rule_unset(r, NFTNL_RULE_POSITION);
- batch_rule_add(h, NFT_COMPAT_RULE_REPLACE, r);
+ ret = batch_rule_add(h, NFT_COMPAT_RULE_REPLACE, r);
+ if (ret)
+ return -1;
}
r = nftnl_rule_iter_next(iter);
}