]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
firewall-util-nft: clear previous address on replay
authorFlorian Westphal <fw@strlen.de>
Thu, 17 Dec 2020 11:52:53 +0000 (12:52 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 19 Jan 2021 15:38:56 +0000 (16:38 +0100)
In case external entity wiped the ruleset, we need to clear the
'previous' address -- its already gone.

This prevents the transaction from succeeding: the delete operation fails.

src/shared/firewall-util-nft.c

index 2e5ba97259e9c729aa35951c1693c7a7d7955395..22c0dc0980c7737c1b9f0dd545dd5200d3a4b8bf 100644 (file)
@@ -1062,6 +1062,8 @@ again:
                 int tmp = fw_nftables_recreate_table(ctx->nfnl, af, transaction, tsize);
 
                 if (tmp == 0) {
+                        /* table created anew; previous address already gone */
+                        previous_remote = NULL;
                         retry = false;
                         goto again;
                 }