path: root/iptables/xtables.c
diff options
authorPhil Sutter <>2018-12-30 20:06:10 +0100
committerPablo Neira Ayuso <>2019-01-11 14:06:33 +0100
commit41358d474357a39d616302c03cd7f943e19969a2 (patch)
treecb298ebb6d8a54ae1ecd2581ea7601e2021f9b19 /iptables/xtables.c
parent4441b7da7995ed87741164ef39e99f1065eb9637 (diff)
xtables: Set errno in nft_rule_check() if chain not found
With this, the explicit check for chain existence can be removed from xtables.c since all related commands do this now. Note that this effectively changes the error message printed by iptables-nft when given a non-existing chain, but the new error message(s) conform with those printed by legacy iptables. Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'iptables/xtables.c')
1 files changed, 0 insertions, 4 deletions
diff --git a/iptables/xtables.c b/iptables/xtables.c
index 24a6e234..da11e8cc 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -1064,10 +1064,6 @@ void do_parse(struct nft_handle *h, int argc, char *argv[],
- if (!p->xlate && !nft_chain_exists(h, p->table, p->chain))
- xtables_error(OTHER_PROBLEM,
- "Chain '%s' does not exist", p->chain);
if (!p->xlate && !cs->target && strlen(cs->jumpto) > 0 &&
!nft_chain_exists(h, p->table, cs->jumpto))