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

Virtual interfaces for VRR bounced during ifreload -a

Ticket: CM-8143
Reviewed By: scotte, roopa
Testing Done: ssim and powerpc

This was first seen as a side issue with switchd terminating and not restarting (filed as CM-8109).

When ifreload -a is issued, all of the vrr interfaces were bounced, even though there were not any
configuration changes.

In keeping with the philosphy of making ifreload non-disruptive, this patch no longer
disrupts vrrs if the existing config has not changed.
This commit is contained in:
Sam Tannous
2015-11-16 23:43:39 -05:00
parent 54713cee98
commit 5df79763d3

View File

@@ -164,15 +164,19 @@ class addressvirtual(moduleBase):
rtnetlink_api.rtnl_api.create_macvlan(macvlan_ifacename, rtnetlink_api.rtnl_api.create_macvlan(macvlan_ifacename,
ifaceobj.name) ifaceobj.name)
link_created = True link_created = True
if av_attrs[0] != 'None': mac = av_attrs[0]
self.ipcmd.link_set_hwaddress(macvlan_ifacename, av_attrs[0]) ips = av_attrs[1:]
hwaddress.append(av_attrs[0]) if mac != 'None':
self.ipcmd.addr_add_multiple(macvlan_ifacename, av_attrs[1:], mac = mac.lower()
# customer could have used UPPERCASE for MAC
self.ipcmd.link_set_hwaddress(macvlan_ifacename, mac)
hwaddress.append(mac)
self.ipcmd.addr_add_multiple(macvlan_ifacename, ips,
purge_existing) purge_existing)
# If link existed before, flap the link # If link existed before, flap the link
if not link_created: if not link_created:
self._fix_connected_route(ifaceobj, macvlan_ifacename, self._fix_connected_route(ifaceobj, macvlan_ifacename,
av_attrs[1]) ips[0])
av_idx += 1 av_idx += 1
self.ipcmd.batch_commit() self.ipcmd.batch_commit()
@@ -181,7 +185,7 @@ class addressvirtual(moduleBase):
oldmacs = self._get_macs_from_old_config(ifaceobj) oldmacs = self._get_macs_from_old_config(ifaceobj)
# get a list of fdbs in old that are not in new config meaning they should # get a list of fdbs in old that are not in new config meaning they should
# be removed since they are gone from the config # be removed since they are gone from the config
removed_macs = [mac for mac in oldmacs if mac not in hwaddress] removed_macs = [mac for mac in oldmacs if mac.lower() not in hwaddress]
self._remove_addresses_from_bridge(ifaceobj, removed_macs) self._remove_addresses_from_bridge(ifaceobj, removed_macs)
# if ifaceobj is a bridge and bridge is a vlan aware bridge # if ifaceobj is a bridge and bridge is a vlan aware bridge
# add the vid to the bridge # add the vid to the bridge