summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-10-17 21:42:38 +0200
committerChristian Breunig <christian@breunig.cc>2026-10-17 21:42:38 +0200
commit07febc39a4c82d6e5f41aa28c85fef153b98f402 (patch)
tree1bd3cd3f42d11002d32e10cb2c984c88afb4909f /data
parentcc9e15daa0a8e766b32ad6aa0baea26675eaf9a6 (diff)
downloadvyos-1x-07febc39a4c82d6e5f41aa28c85fef153b98f402.tar.gz
vyos-1x-07febc39a4c82d6e5f41aa28c85fef153b98f402.zip
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.
Diffstat (limited to 'data')
-rw-r--r--data/templates/conntrack/nftables-ct.j27
1 files changed, 3 insertions, 4 deletions
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 %}