Merge "Prevent LBaaS VRRP ports from populating DVR router ARP table"

This commit is contained in:
Zuul 2017-12-13 07:56:20 +00:00 committed by Gerrit Code Review
commit c021ba6e39
2 changed files with 15 additions and 1 deletions

View File

@ -274,9 +274,12 @@ class DvrLocalRouter(dvr_router_base.DvrRouterBase):
# TODO(Carl) Can we eliminate the need to make this RPC while
# processing a router.
subnet_ports = self.agent.get_ports_by_subnet(subnet_id)
ignored_device_owners = (
lib_constants.ROUTER_INTERFACE_OWNERS +
tuple(common_utils.get_dvr_allowed_address_pair_device_owners()))
for p in subnet_ports:
if p['device_owner'] not in lib_constants.ROUTER_INTERFACE_OWNERS:
if p['device_owner'] not in ignored_device_owners:
for fixed_ip in p['fixed_ips']:
self._update_arp_entry(fixed_ip['ip_address'],
p['mac_address'],

View File

@ -496,6 +496,17 @@ class TestDvrRouterOperations(base.BaseTestCase):
test_ports = [{'mac_address': '00:11:22:33:44:55',
'device_owner': lib_constants.DEVICE_OWNER_DHCP,
'fixed_ips': [{'ip_address': '1.2.3.4',
'prefixlen': 24,
'subnet_id': subnet_id}]},
{'mac_address': '11:22:33:44:55:66',
'device_owner': lib_constants.DEVICE_OWNER_LOADBALANCER,
'fixed_ips': [{'ip_address': '1.2.3.5',
'prefixlen': 24,
'subnet_id': subnet_id}]},
{'mac_address': '22:33:44:55:66:77',
'device_owner':
lib_constants.DEVICE_OWNER_LOADBALANCERV2,
'fixed_ips': [{'ip_address': '1.2.3.6',
'prefixlen': 24,
'subnet_id': subnet_id}]}]