summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2025-06-19 15:21:35 +0100
committerGitHub <noreply@github.com>2025-06-19 15:21:35 +0100
commit1c72ef9a39245b76bd79b8c7d46e806f84a148c9 (patch)
tree82f403cb0f86e7186cf5dd9971a5dbb68378b51c /src
parent5ae3924234f9ffaa2ffda7e9fc52c2b3518a85e2 (diff)
parentf7ce71b4e464582450eada5112cdfbd86f39436d (diff)
downloadvyos-1x-1c72ef9a39245b76bd79b8c7d46e806f84a148c9.tar.gz
vyos-1x-1c72ef9a39245b76bd79b8c7d46e806f84a148c9.zip
Merge pull request #4566 from jestabro/static-route-migration
migration: T6968: check for ip address as next-hop-interface
Diffstat (limited to 'src')
-rw-r--r--src/migration-scripts/quagga/8-to-918
1 files changed, 13 insertions, 5 deletions
diff --git a/src/migration-scripts/quagga/8-to-9 b/src/migration-scripts/quagga/8-to-9
index eece6c15d..c28e07e5c 100644
--- a/src/migration-scripts/quagga/8-to-9
+++ b/src/migration-scripts/quagga/8-to-9
@@ -16,6 +16,7 @@
# - T2450: drop interface-route and interface-route6 from "protocols static"
from vyos.configtree import ConfigTree
+from vyos.template import is_ip
def migrate_interface_route(config, base, path, route_route6):
""" Generic migration function which can be called on every instance of
@@ -31,11 +32,18 @@ def migrate_interface_route(config, base, path, route_route6):
tmp = base + path + [route, 'next-hop-interface']
for interface in config.list_nodes(tmp):
- new_base = base + [route_route6, route, 'interface']
- config.set(new_base)
- config.set_tag(base + [route_route6])
- config.set_tag(new_base)
- config.copy(tmp + [interface], new_base + [interface])
+ if is_ip(interface): # not prohibited in 1.3.x, hence allowed
+ new_base = base + [route_route6, route, 'next-hop']
+ config.set(new_base)
+ config.set_tag(base + [route_route6])
+ config.set_tag(new_base)
+ config.copy(tmp + [interface], new_base + [interface])
+ else:
+ new_base = base + [route_route6, route, 'interface']
+ config.set(new_base)
+ config.set_tag(base + [route_route6])
+ config.set_tag(new_base)
+ config.copy(tmp + [interface], new_base + [interface])
config.delete(base + path)