ebtables: Avoid dropping policy when flushing
Phil Sutter
reviewerPATCH 1/1 ebtables: Avoid dropping policy when flushing
Unlike nftables, ebtables' user-defined chains have policies - ebtables-nft implements those internally as invisible last rule. In order to recreate them after a flush command, a rule cache is needed.
https://bugzilla.netfilter.org/show_bug.cgi?id=1558
Signed-off-by Phil Sutter <[email protected]>
--- iptables/nft-cmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
iptables/nft-cmd.c +3 -1
@@ -167,7 +167,9 @@ int nft_cmd_rule_flush(struct nft_handle *h, const char *chain,if (!cmd)return 0 ; -if (chain || verbose) +if (h->family ==NFPROTO_BRIDGE ) +nft_cache_level_set (h,NFT_CL_RULES , cmd); +else if (chain || verbose)nft_cache_level_set (h,NFT_CL_CHAINS , cmd);else nft_cache_level_set (h,NFT_CL_TABLES , cmd);
Signature · 1 line
2.33.0
Phil Sutter
reviewerQuoted 6 lines · Phil Sutter
Unlike nftables, ebtables' user-defined chains have policies - ebtables-nft implements those internally as invisible last rule. In order to recreate them after a flush command, a rule cache is needed.
https://bugzilla.netfilter.org/show_bug.cgi?id=1558
Signed-off-by Phil Sutter <[email protected]>
Pushed this one after adding a testcase asserting correct behaviour.
Cheers, Phil