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

addons: bridge: fix running_vids value when cache is stale

Ticket: CM-12552
Reviewed By: julien, nikhil
Testing Done: tested with failing config with bridge-access 1

This is similar to the fix done in the below commit for pvid:
"5061730ea5bf ("addons: bridge: fix default pvid handling in cases where
cache is stale")"

easier steps to reproduce:
- have a vlan aware bridge with more than one ports
- add 'bridge-access 1' to one of the ports
- boot the box with the config
- check that the  vlans are fine
- ifdown <interface_with_bridge_access_1>
- ifreload -a
- the interface with bridge_access 1 does
not have the pvid flag on vlan 1

This patch makes sure we assume the right running
vid and pvid value ie [1] and 1 if the
cache returns no values. vid = [1] and pvid = 1
are the kernel default/initial values for a port.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
Roopa Prabhu
2016-08-19 11:09:57 -07:00
committed by Nikhil
parent 0184c8c537
commit 5859b3228e

View File

@@ -882,17 +882,21 @@ class bridge(moduleBase):
(running_vids, running_pvid) = self._get_running_vids_n_pvid(
bportifaceobj.name)
if running_vids:
(vids_to_del, vids_to_add) = \
self._diff_vids(vids_to_add, running_vids)
if not running_pvid:
if not running_vids and not running_pvid:
# There cannot be a no running pvid.
# It might just not be in our cache:
# this can happen if at the time we were
# creating the bridge vlan cache, the port
# was not part of the bridge
# was not part of the bridge. And we need
# to make sure both vids and pvid is not in
# the cache, to declare that our cache may
# be stale.
running_pvid = 1
running_vids = [1]
if running_vids:
(vids_to_del, vids_to_add) = \
self._diff_vids(vids_to_add, running_vids)
if running_pvid:
if running_pvid != pvid_int and running_pvid != 0: