]> git.ipfire.org Git - thirdparty/iptables.git/commit
iptables: Fix handling of non-existent chains
authorJacek Tomasiak <jacek.tomasiak@gmail.com>
Mon, 19 Jun 2023 11:46:36 +0000 (13:46 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 21 Jun 2023 11:47:17 +0000 (13:47 +0200)
commit82ccfb488eeac5507471099b9b4e6d136cc06e3b
tree2f5de8053a9dce851231c0e1e223c83611df7d72
parented839159edf8bda8e9196f1056c4038c22d78bfd
iptables: Fix handling of non-existent chains

Since 694612adf87 the "compatibility" check considers non-existent
chains as "incompatible". This broke some scripts which used calls
like `iptables -L CHAIN404` to test for chain existence and expect
"No chain/target/match by that name." in the output.

This patch changes the logic of `nft_is_table_compatible()` to
report non-existent chains as "compatible" which restores the old
behavior.

Fixes: 694612adf87 ("nft: Fix selective chain compatibility checks")
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1648
Signed-off-by: Jacek Tomasiak <jtomasiak@arista.com>
Signed-off-by: Jacek Tomasiak <jacek.tomasiak@gmail.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/nft.c
iptables/tests/shell/testcases/iptables/0004-return-codes_0