diff --git a/interface-definitions/include/dhcp/option-v6.xml.i b/interface-definitions/include/dhcp/option-v6.xml.i index 1df0c3934d..e1897f52d9 100644 --- a/interface-definitions/include/dhcp/option-v6.xml.i +++ b/interface-definitions/include/dhcp/option-v6.xml.i @@ -78,6 +78,18 @@ + + + Time (in seconds) that stateless clients should wait between refreshing the information they were given + + u32:1-4294967295 + DHCPv6 information refresh time + + + + + + Vendor Specific Options diff --git a/interface-definitions/include/version/dhcpv6-server-version.xml.i b/interface-definitions/include/version/dhcpv6-server-version.xml.i index 1f30368a32..8b72a9c720 100644 --- a/interface-definitions/include/version/dhcpv6-server-version.xml.i +++ b/interface-definitions/include/version/dhcpv6-server-version.xml.i @@ -1,3 +1,3 @@ - + diff --git a/interface-definitions/service_dhcpv6-server.xml.in b/interface-definitions/service_dhcpv6-server.xml.in index daca7b43fb..cf14388e8a 100644 --- a/interface-definitions/service_dhcpv6-server.xml.in +++ b/interface-definitions/service_dhcpv6-server.xml.in @@ -63,27 +63,7 @@ - - - Common options to distribute to all clients, including stateless clients - - - - - Time (in seconds) that stateless clients should wait between refreshing the information they were given - - u32:1-4294967295 - DHCPv6 information refresh time - - - - - - - #include - #include - - + #include IPv6 DHCP subnet for this shared network diff --git a/python/vyos/template.py b/python/vyos/template.py index 3507e0940f..aa99bed5a6 100644 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -922,8 +922,8 @@ def kea6_shared_network_json(shared_networks): 'subnet6': [] } - if 'common_options' in config: - network['option-data'] = kea6_parse_options(config['common_options']) + if 'option' in config: + network['option-data'] = kea6_parse_options(config['option']) if 'interface' in config: network['interface'] = config['interface'] diff --git a/src/migration-scripts/dhcpv6-server/5-to-6 b/src/migration-scripts/dhcpv6-server/5-to-6 new file mode 100644 index 0000000000..cad0a35388 --- /dev/null +++ b/src/migration-scripts/dhcpv6-server/5-to-6 @@ -0,0 +1,31 @@ +# Copyright 2024 VyOS maintainers and contributors +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see . + +# T6648: Rename "common-options" to "option" at shared-network level + +from vyos.configtree import ConfigTree + +base = ['service', 'dhcpv6-server', 'shared-network-name'] + +def migrate(config: ConfigTree) -> None: + if not config.exists(base): + # Nothing to do + return + + for network in config.list_nodes(base): + if not config.exists(base + [network, 'common-options']): + continue + + config.rename(base + [network, 'common-options'], 'option')