From 37a9b478a5f37229394bed37ac506ccf3e2f1403 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Sat, 2 May 2020 17:03:56 +0100 Subject: dictconfig: T2372: fix interfaces disable bug off-by one line where the IP were added to the add list and not the remove list --- python/vyos/configdict.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index dea8a5d01..e1b704a31 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -312,31 +312,31 @@ def intf_to_dict(conf, default): if disabled == disable.both: # was and is still disabled intf['disable'] = True - intf['address_remove'] = [] intf['address'] = [] + intf['address_remove'] = [] intf['ipv6_eui64_prefix'] = [] intf['ipv6_eui64_prefix_remove'] = [] elif disabled == disable.now: # it is now disable but was not before intf['disable'] = True - intf['address_remove'] = eff_addr intf['address'] = [] - intf['ipv6_eui64_prefix'] = eff_eui - intf['ipv6_eui64_prefix_remove'] = [] + intf['address_remove'] = eff_addr + intf['ipv6_eui64_prefix'] = [] + intf['ipv6_eui64_prefix_remove'] = eff_eui elif disabled == disable.was: # it was disable but not anymore intf['disable'] = False - intf['address_remove'] = [] intf['address'] = act_addr - intf['ipv6_eui64_prefix'] = [] - intf['ipv6_eui64_prefix_remove'] = act_eui + intf['address_remove'] = [] + intf['ipv6_eui64_prefix'] = act_eui + intf['ipv6_eui64_prefix_remove'] = [] else: # normal change intf['disable'] = False - intf['address_remove'] = list_diff(eff_addr, act_addr) intf['address'] = act_addr - intf['ipv6_eui64_prefix_remove'] = list_diff(eff_eui, act_eui) + intf['address_remove'] = list_diff(eff_addr, act_addr) intf['ipv6_eui64_prefix'] = act_eui + intf['ipv6_eui64_prefix_remove'] = list_diff(eff_eui, act_eui) # Remove the default link-local address if set. if conf.exists('ipv6 address no-default-link-local'): -- cgit v1.2.3