From af73882a9db994b06d8df18d4d5abc05c7aecd32 Mon Sep 17 00:00:00 2001 From: Daniel Russell Date: Wed, 29 Nov 2017 15:27:06 +1100 Subject: [PATCH] Prevent LBaaS VRRP ports from populating DVR router ARP table Prevents the MAC address of the VIP address of an LBaaS or LBaaSv2 instance from populating in the DVR router ARP table Change-Id: If49aaa48a5e95ccd0a236db984d3984a6e44c87c Closes-Bug: 1733852 --- neutron/agent/l3/dvr_local_router.py | 5 ++++- neutron/tests/unit/agent/l3/test_dvr_local_router.py | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/neutron/agent/l3/dvr_local_router.py b/neutron/agent/l3/dvr_local_router.py index ebd4968e76a..0fdf9caf486 100644 --- a/neutron/agent/l3/dvr_local_router.py +++ b/neutron/agent/l3/dvr_local_router.py @@ -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'], diff --git a/neutron/tests/unit/agent/l3/test_dvr_local_router.py b/neutron/tests/unit/agent/l3/test_dvr_local_router.py index 6a0b6b58843..2345b5cb339 100644 --- a/neutron/tests/unit/agent/l3/test_dvr_local_router.py +++ b/neutron/tests/unit/agent/l3/test_dvr_local_router.py @@ -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}]}]