For each VRRP configuration we create 2 macvlans (ip4 and ip6), if the ip4
is removed from the config we need to remove the associated macvlan (same
for ip6).
Testing Done: remove all ip4 (or ip6) from vrr attribute line
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
"ips": ip4,
"id": vrrp_id
})
+ elif not ip4 and not ifquery:
+ # special check to see if all ipv4 were removed from the vrrp
+ # configuration, if so we need to remove the associated macvlan
+ if self.ipcmd.link_exists(macvlan_ip4_ifname):
+ netlink.link_del(macvlan_ip4_ifname)
if ip6 or ifquery:
# config_ip6
"ips": ip6,
"id": vrrp_id
})
+ elif not ip6 and not ifquery:
+ # special check to see if all ipv6 were removed from the vrrp
+ # configuration, if so we need to remove the associated macvlan
+ if self.ipcmd.link_exists(macvlan_ip6_ifname):
+ netlink.link_del(macvlan_ip6_ifname)
return user_config_list