lb-agent: use 'replace' instead of 'add' with 'bridge fdb'

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
This commit is contained in:
Darragh O'Reilly 2015-03-17 16:03:51 +00:00
parent b5f7cc0d7d
commit 1476ee63ad
2 changed files with 3 additions and 2 deletions

View 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,

View 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),