From 728b1feaf7444545100b9cba7977c90b75f01029 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 6 Jun 2020 01:01:44 +0200 Subject: dhcpv6-pd: T2551: fix prefix length not set in config Retrieving the CLI nodes from current config was missed out and only implemented for PPPoE. --- python/vyos/configdict.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index ead7e8637..824ca1f71 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -235,8 +235,16 @@ def intf_to_dict(conf, default): # DHCPv6 prefix delegation (RFC3633) current_level = conf.get_level() if conf.exists(['dhcpv6-options', 'prefix-delegation']): - for interface in conf.list_nodes(['dhcpv6-options', 'prefix-delegation', 'interface']): - conf.set_level(current_level + ['dhcpv6-options', 'prefix-delegation', 'interface', interface]) + dhcpv6_pd_path = current_level + ['dhcpv6-options', 'prefix-delegation'] + conf.set_level(dhcpv6_pd_path) + + # retriebe DHCPv6-PD prefix helper length as some ISPs only hand out a + # /64 by default (https://phabricator.vyos.net/T2506) + if conf.exists(['length']): + intf['dhcpv6_pd_length'] = conf.return_value(['length']) + + for interface in conf.list_nodes(['interface']): + conf.set_level(current_level + ['interface', interface]) pd = { 'ifname': interface, 'sla_id': '', -- cgit v1.2.3