]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
lb-agent: use 'replace' instead of 'add' with 'bridge fdb'
authorDarragh O'Reilly <darragh.oreilly@hp.com>
Tue, 17 Mar 2015 16:03:51 +0000 (16:03 +0000)
committerDarragh O'Reilly <darragh.oreilly@hp.com>
Wed, 25 Mar 2015 11:33:59 +0000 (11:33 +0000)
l2pop on the linuxbridge agent can fail to add permanent entries
because the 'bridge fdb add' command fails if a temporary entry
exists. This patch uses 'replace' which always works.

Closes-Bug: 1367999
Change-Id: I4371f508ad23d96de950634b4a90218ea474f3f0

neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py

index 50cab5dc1bde5b8fb655a9551e005ad9f389c5e0..c4eee0884bb875261aadb3acfd76614e73648cf9 100644 (file)
@@ -613,7 +613,8 @@ class LinuxBridgeManager(object):
         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)
+                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,
index c80ee67e9a7a3e87dd2663191968b80743cfbef0..0f7f85e07bc46f40312f9f1704e5cde9395868aa 100644 (file)
@@ -972,7 +972,7 @@ class TestLinuxBridgeRpcCallbacks(base.BaseTestCase):
                            'port_mac', 'dev', 'vxlan-1', 'nud', 'permanent'],
                           run_as_root=True,
                           check_exit_code=False),
-                mock.call(['bridge', 'fdb', 'add', 'port_mac', 'dev',
+                mock.call(['bridge', 'fdb', 'replace', 'port_mac', 'dev',
                            'vxlan-1', 'dst', 'agent_ip'],
                           run_as_root=True,
                           check_exit_code=False),