1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

addons: vxlan: remote-ip: purge entry removed by user

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
This commit is contained in:
Julien Fortin
2022-03-25 14:13:42 +01:00
parent 2fbbfa7211
commit 35a4278ffb

View File

@ -1241,7 +1241,11 @@ class vxlan(Vxlan, moduleBase):
except Exception as e:
self.log_error('%s: vxlan-remoteip: %s' % (ifaceobj.name, str(e)))
if vxlan_purge_remotes or remoteips:
# get old remote ips to compare with new user config value and
# purge any removed remote ip
old_remoteips = self.get_old_remote_ips(ifaceobj.name)
if vxlan_purge_remotes or remoteips or (remoteips != old_remoteips):
# figure out the diff for remotes and do the bridge fdb updates
# only if provisioned by user and not by an vxlan external
# controller.
@ -1283,6 +1287,14 @@ class vxlan(Vxlan, moduleBase):
self.vxlan_remote_ip_map(ifaceobj, vxlan_mcast_grp_map)
@staticmethod
def get_old_remote_ips(ifname):
old_remoteips = []
for old_ifaceobj in statemanager.get_ifaceobjs(ifname) or []:
for remote in old_ifaceobj.get_attr_value("vxlan-remoteip") or []:
old_remoteips.append(remote)
return old_remoteips
def vxlan_remote_ip_map(self, ifaceobj, vxlan_mcast_grp_map):
# get user configured remote ip map
vxlan_remote_ip_map = self.__get_vxlan_remote_ip_map(ifaceobj) or {}