Skip to contentSkip to conversation

Prevent labeling of vlans with the same color

PATCH New Stefan Berger 1 participant 1 message Apr 3, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Prevent labeling of vlans with the same color

This patch prevents the labeling of vlans with the same color.

xen-unstable.hg/tools/python/xen/util/xsm/acm/acm.py +3 -0
Index: root/xen-unstable.hg/tools/python/xen/util/xsm/acm/acm.py
===================================================================
@@ -1236,6 +1236,9 @@ def set_resource_label(resource, policyt
                 return -xsconstants.XSERR_BAD_LABEL
             if tmp[2] != oreslabel:
                 return -xsconstants.XSERR_BAD_LABEL
+        if resource.startswith('vlan:'):
+            if tuple([policytype, policyref, reslabel]) in access_control.values():
+                return -xsconstants.XSERR_BAD_LABEL
         if reslabel != "":
             new_entry = { resource : tuple([policytype, policyref, reslabel])}
             access_control.update(new_entry)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel