From 07febc39a4c82d6e5f41aa28c85fef153b98f402 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 17 Oct 2026 21:42:38 +0200 Subject: conntrack: T9474: rebuild conntrack tables when rule file and table drift apart The conntrack ruleset only deleted the existing tables when its rule file in /run was present. A table removed while the file stayed made the delete, and with it every following commit, fail. The tables are now declared right before they are deleted, so each commit rebuilds them regardless of what is currently loaded. --- data/templates/conntrack/nftables-ct.j2 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'data') diff --git a/data/templates/conntrack/nftables-ct.j2 b/data/templates/conntrack/nftables-ct.j2 index 0f0c49c76..327ca9fd2 100644 --- a/data/templates/conntrack/nftables-ct.j2 +++ b/data/templates/conntrack/nftables-ct.j2 @@ -3,9 +3,9 @@ {% import 'conntrack/nftables-helpers.j2' as helper_tmpl %} {% import 'firewall/nftables-defines.j2' as group_tmpl %} -{% if first_install is not vyos_defined %} +# declaring the table first makes the delete succeed whether or not it exists +table ip vyos_conntrack delete table ip vyos_conntrack -{% endif %} table ip vyos_conntrack { chain VYOS_CT_IGNORE { {% if ignore.ipv4.rule is vyos_defined %} @@ -101,9 +101,8 @@ table ip vyos_conntrack { {% endif %} } -{% if first_install is not vyos_defined %} +table ip6 vyos_conntrack delete table ip6 vyos_conntrack -{% endif %} table ip6 vyos_conntrack { chain VYOS_CT_IGNORE { {% if ignore.ipv6.rule is vyos_defined %} -- cgit v1.2.3