Skip to content

Commit

Permalink
Fix losses of ovs flows when ovs is restarted
Browse files Browse the repository at this point in the history
Reinitialize conj_ip_manager when OVS is restarted.

Closes-Bug: #1912651
Change-Id: I5b5cf563f0c3d6ea352303f76323177cffc57c6e
(cherry picked from commit 412160b)
  • Loading branch information
mgariepy committed Feb 5, 2021
1 parent 04e1a63 commit f9827eb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions neutron/agent/linux/openvswitch_firewall/firewall.py
Expand Up @@ -476,9 +476,7 @@ def __init__(self, integration_bridge):
"""
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)
Expand All @@ -492,8 +490,14 @@ def __init__(self, integration_bridge):

def _init_firewall_callback(self, resource, event, trigger, payload=None):
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()
Expand Down

0 comments on commit f9827eb

Please sign in to comment.