[ovs-dev] [PATCH] ovs-vtep: Modify patch port name separators

Gurucharan Shetty shettyg at nicira.com
Wed Sep 10 15:51:58 UTC 2014


On Tue, Sep 9, 2014 at 9:18 AM, Mark Maglana <mmaglana at gmail.com> wrote:
> On Tue, Sep 9, 2014 at 8:04 AM, Gurucharan Shetty <shettyg at nicira.com>
> wrote:
>>
>> I see that there is a bug. With your patch, would we still hit the bug
>> if the port name has a "--" in it?
>
>
> Definitely. Although I'm guessing that the probability of "--" being in the
> port name is negligible. I can make it more unique if needed. Probably ":::"
> or any other character that's still valid as port of a patch port name (not
> sure if there's a list out there I can reference).

Does the following fox the problem for you?
diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep
index a9e79bf..ff65a51 100755
--- a/vtep/ovs-vtep
+++ b/vtep/ovs-vtep
@@ -300,7 +300,10 @@ class Logical_Switch(object):
         for interface in self.ports.iterkeys():
             if not interface.endswith("-l"):
                 continue
-            vlan, pp_name, logical = interface.split("-")
+
+            #port names can have a '-' in it.
+            vlan, remainder = interface.split("-", 1)
+            pp_name, logical = remainder.rsplit("-", 1)
             uuid = vtep_ctl("get physical_port %s vlan_stats:%s"
                             % (pp_name, vlan))
             if not uuid:
@@ -470,7 +473,7 @@ def run_bfd():
 def add_binding(binding, ls):
     vlog.info("adding binding %s" % binding)

-    vlan, pp_name = binding.split("-")
+    vlan, pp_name = binding.split("-", 1)
     pbinding = binding+"-p"
     lbinding = binding+"-l"



More information about the dev mailing list