Don't add arp responder for non tunnel network port
When the vlan and vxlan both exist in env, and l2population
and arp_responder are enabled, if we update a port's ip address
from vlan network, there will be arp responder related flows
added into br-tun, this will cause too many arp reply for
one arp request, and vm connections will be unnormal.
Closes-Bug: #1824504
Change-Id: I1b6154b9433a9442d3e0118dedfa01c4a9b4740b
(cherry picked from commit 5301ecf41b
)
This commit is contained in:
parent
5bba624867
commit
514a18ee92
|
@ -120,6 +120,13 @@ class L2populationMechanismDriver(api.MechanismDriver):
|
||||||
if not agent_host:
|
if not agent_host:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# We should not add arp responder for non tunnel network type
|
||||||
|
port_context = context._plugin_context
|
||||||
|
agent = l2pop_db.get_agent_by_host(port_context, agent_host)
|
||||||
|
segment = context.bottom_bound_segment
|
||||||
|
if not self._validate_segment(segment, port['id'], agent):
|
||||||
|
return
|
||||||
|
|
||||||
agent_ip = l2pop_db.get_agent_ip_by_host(context._plugin_context,
|
agent_ip = l2pop_db.get_agent_ip_by_host(context._plugin_context,
|
||||||
agent_host)
|
agent_host)
|
||||||
|
|
||||||
|
|
|
@ -1090,6 +1090,35 @@ class TestL2PopulationRpcTestCase(test_plugin.Ml2PluginV2TestCase):
|
||||||
self.mock_fanout.assert_called_with(
|
self.mock_fanout.assert_called_with(
|
||||||
mock.ANY, 'add_fdb_entries', add_expected)
|
mock.ANY, 'add_fdb_entries', add_expected)
|
||||||
|
|
||||||
|
def test_fixed_ips_changed_vlan(self):
|
||||||
|
self._register_ml2_agents()
|
||||||
|
|
||||||
|
with self.subnet(network=self._network2) as subnet:
|
||||||
|
host_arg = {portbindings.HOST_ID: HOST}
|
||||||
|
fixed_ips = [{'subnet_id': subnet['subnet']['id'],
|
||||||
|
'ip_address': '10.0.0.2'}]
|
||||||
|
with self.port(subnet=subnet, cidr='10.0.0.0/24',
|
||||||
|
device_owner=DEVICE_OWNER_COMPUTE,
|
||||||
|
arg_list=(portbindings.HOST_ID,),
|
||||||
|
fixed_ips=fixed_ips,
|
||||||
|
**host_arg) as port:
|
||||||
|
p = port['port']
|
||||||
|
|
||||||
|
device = 'tap' + p['id']
|
||||||
|
|
||||||
|
self.callbacks.update_device_up(self.adminContext,
|
||||||
|
agent_id=HOST,
|
||||||
|
device=device)
|
||||||
|
|
||||||
|
data = {'port': {'fixed_ips': [{'ip_address': '10.0.0.2'},
|
||||||
|
{'ip_address': '10.0.0.10'}]}}
|
||||||
|
self.new_update_request('ports', data, p['id'])
|
||||||
|
l2pop_mech = l2pop_mech_driver.L2populationMechanismDriver()
|
||||||
|
l2pop_mech.L2PopulationAgentNotify = mock.Mock()
|
||||||
|
l2notify = l2pop_mech.L2PopulationAgentNotify
|
||||||
|
l2notify.update_fdb_entries = mock.Mock()
|
||||||
|
self.assertFalse(l2notify.update_fdb_entries.called)
|
||||||
|
|
||||||
def test_fixed_ips_changed(self):
|
def test_fixed_ips_changed(self):
|
||||||
self._register_ml2_agents()
|
self._register_ml2_agents()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue