Signed-off-by: Darrell Ball <[email protected]>
---
vtep/ovs-vtep | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep
index 46a5692..54bf0db 100755
--- a/vtep/ovs-vtep
+++ b/vtep/ovs-vtep
@@ -135,15 +135,31 @@ class Logical_Switch(object):
ovs_ofctl("add-flow %s table=1,priority=1,in_port=%s,action=%s"
% (self.short_name, port_no, ",".join(flood_ports)))
+ existing_flow = 0
+ appended_flood_tunnel_port = 0
+ flows = ovs_ofctl("dump-flows %s table=1,cookie=0x4848/-1"
+ % self.short_name).splitlines()
+ for f in flows:
+ if ("table" in f):
+ existing_flow = 1
+ break
+
# Traffic coming from a VTEP physical port should only be flooded to
# one 'unknown-dst' and to all other physical ports that belong to that
# VTEP device and this logical switch.
for tunnel in self.unknown_dsts:
port_no = self.tunnels[tunnel][0]
flood_ports.append(port_no)
+ appended_flood_tunnel_port = 1
break
-
- ovs_ofctl("add-flow %s table=1,priority=0,action=%s"
+ # Handle remote tunnel port set changes
+ if ((existing_flow == 1) and (appended_flood_tunnel_port == 1)):
+ ovs_ofctl(
+ "mod-flows %s table=1,priority=0,cookie=0x4848/-1,action=%s"
+ % (self.short_name, ",".join(flood_ports)))
+ elif (existing_flow == 0):
+ ovs_ofctl(
+ "add-flow %s table=1,priority=0,cookie=0x4848,action=%s"
% (self.short_name, ",".join(flood_ports)))
def add_lbinding(self, lbinding):
--
1.9.1
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev