Since commit 80251bc2a56ed ("nft: remove cache build calls"), 'chain' parameter passed to nft_chain_list_get() is no longer effective. To still support running nft_is_chain_compatible() on specific chains only, add a short path to nft_is_table_compatible(). Follow-up patches will kill nft_chain_list_get(), so don't bother dropping the unused parameter from its signature. Fixes: 80251bc2a56ed ("nft: remove cache build calls") Signed-off-by: Phil Sutter <phil@xxxxxx> --- iptables/nft.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/iptables/nft.c b/iptables/nft.c index 27bb98d184c7c..669e29d4cf88f 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -3453,6 +3453,12 @@ bool nft_is_table_compatible(struct nft_handle *h, { struct nftnl_chain_list *clist; + if (chain) { + struct nftnl_chain *c = nft_chain_find(h, table, chain); + + return c && !nft_is_chain_compatible(c, h); + } + clist = nft_chain_list_get(h, table, chain); if (clist == NULL) return false; -- 2.28.0