From c3592c83288e676e1be534f48266a471a75f32eb Mon Sep 17 00:00:00 2001 From: Robert Simon Date: Wed, 17 Mar 2021 15:41:55 +0000 Subject: [PATCH] Add condition for the create_tap_service method in ovs_taas.py Check the hybrid firewall driver usage. Closes-Bug: #1919340 Change-Id: Iaf1bcc04d292b51f88264babef5b341bb86c750b --- .../services/taas/drivers/linux/ovs_taas.py | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/neutron_taas/services/taas/drivers/linux/ovs_taas.py b/neutron_taas/services/taas/drivers/linux/ovs_taas.py index 414f56c6..fd4833c7 100644 --- a/neutron_taas/services/taas/drivers/linux/ovs_taas.py +++ b/neutron_taas/services/taas/drivers/linux/ovs_taas.py @@ -256,16 +256,23 @@ class OvsTaasDriver(taas_base.TaasAgentDriver): # # Disable mac-address learning in the Linux bridge to which - # the OVS port is attached (via the veth pair). This will - # effectively turn the bridge into a hub, ensuring that all - # incoming mirrored traffic reaches the tap interface (used - # for attaching a VM to the bridge) irrespective of the + # the OVS port is attached (via the veth pair) if the system + # uses OVSHybridIptablesFirewallDriver (Linux bridge & OVS). + # This will effectively turn the bridge into a hub, ensuring + # that all incoming mirrored traffic reaches the tap interface + # (used for attaching a VM to the bridge) irrespective of the # destination mac addresses in mirrored packets. # - ovs_port_name = ovs_port.port_name - linux_br_name = ovs_port_name.replace('qvo', 'qbr') - utils.execute(['brctl', 'setageing', linux_br_name, 0], - run_as_root=True, privsep_exec=True) + + # Get hybrid plug info + vif_details = port.get('binding:vif_details') + is_hybrid_plug = vif_details.get('ovs_hybrid_plug') + + if is_hybrid_plug: + ovs_port_name = ovs_port.port_name + linux_br_name = ovs_port_name.replace('qvo', 'qbr') + utils.execute(['brctl', 'setageing', linux_br_name, 0], + run_as_root=True, privsep_exec=True) return