diff --git a/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py b/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py index c5d3e94..6b3c24a 100644 --- a/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py +++ b/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py @@ -629,14 +629,6 @@ class LinuxBridgeManager(amb.CommonAgentManagerBase): run_as_root=True) return mac in entries - def fdb_bridge_entry_exists(self, mac, interface, agent_ip=None): - entries = utils.execute(['bridge', 'fdb', 'show', 'dev', interface], - run_as_root=True) - if not agent_ip: - return mac in entries - - return (agent_ip in entries and mac in entries) - def add_fdb_ip_entry(self, mac, ip, interface): ip_lib.IPDevice(interface).neigh.add(ip, mac) @@ -655,18 +647,26 @@ class LinuxBridgeManager(amb.CommonAgentManagerBase): run_as_root=True, check_exit_code=False) + def add_fdb_flooding_entry(self, interface, agent_ip, curr_entries): + mac = constants.FLOODING_ENTRY[0] + entry = "%s dst %s self permanent" % (mac, agent_ip) + if entry in curr_entries: + pass + elif mac in curr_entries: + self.add_fdb_bridge_entry(mac, agent_ip, interface, "append") + else: + self.add_fdb_bridge_entry(mac, agent_ip, interface, "add") + def add_fdb_entries(self, agent_ip, ports, interface): + curr_entries = utils.execute(['bridge', 'fdb', 'show', 'dev', + interface], run_as_root=True) for mac, ip in ports: if mac != constants.FLOODING_ENTRY[0]: self.add_fdb_ip_entry(mac, ip, interface) self.add_fdb_bridge_entry(mac, agent_ip, interface, operation="replace") elif self.vxlan_mode == lconst.VXLAN_UCAST: - if self.fdb_bridge_entry_exists(mac, interface): - self.add_fdb_bridge_entry(mac, agent_ip, interface, - "append") - else: - self.add_fdb_bridge_entry(mac, agent_ip, interface) + self.add_fdb_flooding_entry(interface, agent_ip, curr_entries) def remove_fdb_entries(self, agent_ip, ports, interface): for mac, ip in ports: