summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Gariepy <gariepy.marc@gmail.com>2021-01-29 13:21:43 -0500
committerRodolfo Alonso <ralonsoh@redhat.com>2021-02-05 12:12:18 +0000
commit2e52d3f554240b74ef528f1d6bdf173f9563393a (patch)
tree8b2e0d2af26797cb5a643e4a544b9c6c3d7c3318
parentaed188c349794849105c034ffbabf3053d2fcb32 (diff)
downloadneutron-2e52d3f554240b74ef528f1d6bdf173f9563393a.tar.gz
Fix losses of ovs flows when ovs is restarted
Reinitialize conj_ip_manager when OVS is restarted. Closes-Bug: #1912651 Change-Id: I5b5cf563f0c3d6ea352303f76323177cffc57c6e (cherry picked from commit 412160b97fc398f105c3f7386b928eeec2d9e60a)
-rw-r--r--neutron/agent/linux/openvswitch_firewall/firewall.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/neutron/agent/linux/openvswitch_firewall/firewall.py b/neutron/agent/linux/openvswitch_firewall/firewall.py
index 1db2d45d4f..1a68e4431a 100644
--- a/neutron/agent/linux/openvswitch_firewall/firewall.py
+++ b/neutron/agent/linux/openvswitch_firewall/firewall.py
@@ -475,9 +475,7 @@ class OVSFirewallDriver(firewall.FirewallDriver):
"""
self.permitted_ethertypes = cfg.CONF.SECURITYGROUP.permitted_ethertypes
self.int_br = self.initialize_bridge(integration_bridge)
- self.sg_port_map = SGPortMap()
- self.conj_ip_manager = ConjIPFlowManager(self)
- self.sg_to_delete = set()
+ self._initialize_sg()
self._update_cookie = None
self._deferred = False
self.iptables_helper = iptables.Helper(self.int_br.br)
@@ -491,8 +489,14 @@ class OVSFirewallDriver(firewall.FirewallDriver):
def _init_firewall_callback(self, resource, event, trigger, **kwargs):
LOG.info("Reinitialize Openvswitch firewall after OVS restart.")
+ self._initialize_sg()
self._initialize_firewall()
+ def _initialize_sg(self):
+ self.sg_port_map = SGPortMap()
+ self.conj_ip_manager = ConjIPFlowManager(self)
+ self.sg_to_delete = set()
+
def _initialize_firewall(self):
self._drop_all_unmatched_flows()
self._initialize_common_flows()