]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
addons: bridge: fix default pvid handling in cases where cache is stale
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Wed, 10 Aug 2016 22:35:48 +0000 (15:35 -0700)
committerNikhil <nikhil@cumulusnetworks.com>
Wed, 24 Aug 2016 17:19:53 +0000 (10:19 -0700)
Ticket: CM-12355
Reviewed By: julien, nikhil
Testing Done: tested with failing config

This can happen if the bridge vlans were
cached before the interface become a bridge port.
and when the interface becomes a bridge port
kernel adds a default pvid of 1. so this patch
assumes a default pvid is 1 if we did not find
anything in the cache. This will delete
the default pvid of 1 if the user has configured a
different pvid.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
addons/bridge.py

index 96f83c0602f25025e12ff54f41ae259db7b8ffe4..2decf2917dfd11defc8440f7c6b312a13b04b172 100644 (file)
@@ -889,6 +889,13 @@ class bridge(moduleBase):
             if running_pvid:
                 if running_pvid != pvid_int and running_pvid != 0:
                     pvid_to_del = running_pvid
+            else:
+                # 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
+                running_pvid = 1
 
             if (pvid_to_del and (pvid_to_del in vids_int) and
                 (pvid_to_del not in vids_to_add)):