summaryrefslogtreecommitdiff
path: root/src/migration-scripts
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-10-29 12:12:52 +0100
committerChristian Breunig <christian@breunig.cc>2025-10-29 12:22:42 +0100
commitc5ef4f4ebf38a249998498ebe443f3cc733b64fd (patch)
treeb4b8bf596da9a1694408ee2e20623efd3befa1a2 /src/migration-scripts
parent4fbb3c6c9e70d6302ebe11d8a56e221a614449aa (diff)
downloadvyos-1x-c5ef4f4ebf38a249998498ebe443f3cc733b64fd.tar.gz
vyos-1x-c5ef4f4ebf38a249998498ebe443f3cc733b64fd.zip
dhcpv6: T7967: fix migration script for automatic SLAAC selection
Commit f08a5700e7 ("dhcpv6: T7646: restore missing default route after upgrade") introduced a regression affecting both non-VIF and VIF interfaces. The addressing mode check in the migration logic was incorrect for both cases. For non-VIF interfaces, the migration was skipped entirely due to a missing configuration test. For VIF (VLAN) interfaces, the existing test always evaluated to true, since it incorrectly assumed that DHCPv6 was configured even when a static address was present. Smoketests have been extended to cover for these cases.
Diffstat (limited to 'src/migration-scripts')
-rw-r--r--src/migration-scripts/interfaces/32-to-3331
1 files changed, 18 insertions, 13 deletions
diff --git a/src/migration-scripts/interfaces/32-to-33 b/src/migration-scripts/interfaces/32-to-33
index af7b7f497..11b7aa58b 100644
--- a/src/migration-scripts/interfaces/32-to-33
+++ b/src/migration-scripts/interfaces/32-to-33
@@ -23,31 +23,36 @@ def migrate(config: ConfigTree) -> None:
for type in config.list_nodes(['interfaces']):
for interface in config.list_nodes(['interfaces', type]):
iface_base_path = ['interfaces', type, interface]
- dhcpv6_addr_path = iface_base_path + ['address', 'dhcpv6']
- autoconf_path = iface_base_path + ['ipv6', 'address', 'autoconf']
- if config.exists(dhcpv6_addr_path) and not config.exists(autoconf_path):
- config.set(autoconf_path)
+ dhcpv6_addr_path = iface_base_path + ['address']
+
+ if config.exists(dhcpv6_addr_path) and 'dhcpv6' in config.return_values(dhcpv6_addr_path):
+ autoconf_path = iface_base_path + ['ipv6', 'address', 'autoconf']
+ if not config.exists(autoconf_path):
+ config.set(autoconf_path)
vif_path = iface_base_path + ['vif']
if config.exists(vif_path):
for vif in config.list_nodes(vif_path):
vif_dhcpv6_addr_path = vif_path + [vif, 'address']
- vif_autoconf_path = vif_path + [vif, 'ipv6', 'address', 'autoconf']
- if config.exists(vif_dhcpv6_addr_path) and not config.exists(vif_autoconf_path):
- config.set(vif_autoconf_path)
+ if config.exists(vif_dhcpv6_addr_path) and 'dhcpv6' in config.return_values(vif_dhcpv6_addr_path):
+ vif_autoconf_path = vif_path + [vif, 'ipv6', 'address', 'autoconf']
+ if not config.exists(vif_autoconf_path):
+ config.set(vif_autoconf_path)
vif_s_path = iface_base_path + ['vif-s']
if config.exists(vif_s_path):
for vif_s in config.list_nodes(vif_s_path):
vif_s_dhcpv6_addr_path = vif_s_path + [vif_s, 'address']
- vif_s_autoconf_path = vif_s_path + [vif_s, 'ipv6', 'address', 'autoconf']
- if config.exists(vif_s_dhcpv6_addr_path) and not config.exists(vif_s_autoconf_path):
- config.set(vif_s_autoconf_path)
+ if config.exists(vif_s_dhcpv6_addr_path) and 'dhcpv6' in config.return_values(vif_s_dhcpv6_addr_path):
+ vif_s_autoconf_path = vif_s_path + [vif_s, 'ipv6', 'address', 'autoconf']
+ if not config.exists(vif_s_autoconf_path):
+ config.set(vif_s_autoconf_path)
vif_c_path = iface_base_path + ['vif-s', vif_s, 'vif-c']
if config.exists(vif_c_path):
for vif_c in config.list_nodes(vif_c_path):
vif_c_dhcpv6_addr_path = vif_c_path + [vif_c, 'address']
- vif_c_autoconf_path = vif_c_path + [vif_c, 'ipv6', 'address', 'autoconf']
- if config.exists(vif_c_dhcpv6_addr_path) and not config.exists(vif_c_autoconf_path):
- config.set(vif_c_autoconf_path)
+ if config.exists(vif_c_dhcpv6_addr_path) and 'dhcpv6' in config.return_values(vif_c_dhcpv6_addr_path):
+ vif_c_autoconf_path = vif_c_path + [vif_c, 'ipv6', 'address', 'autoconf']
+ if not config.exists(vif_c_autoconf_path):
+ config.set(vif_c_autoconf_path)