From: Ihar Hrachyshka Date: Fri, 11 Sep 2015 18:46:51 +0000 (-0400) Subject: ovs: don't use ARP responder for IPv6 addresses X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a19e64c9d95781982d28113c667dbc90d0ea11eb;p=openstack-build%2Fneutron-build.git ovs: don't use ARP responder for IPv6 addresses ARP does not support IPv6 addresses, so when we try to apply the flow, it fails, with all other flows deferred for the same transaction. It results in random flow breakages, depending on the order of the bad flow in the transaction. Change-Id: I0ecf167653e5a7d0916e091e05050406a026a1e2 Co-Authored-By: Thomas Carroll Closes-Bug: #1477253 --- diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py index f88a01301..f20c013f8 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py @@ -576,8 +576,12 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin, if not self.arp_responder_enabled: return + ip = netaddr.IPAddress(ip_address) + if ip.version == 6: + return + + ip = str(ip) mac = str(netaddr.EUI(mac_address, dialect=_mac_mydialect)) - ip = str(netaddr.IPAddress(ip_address)) if action == 'add': br.install_arp_responder(local_vid, ip, mac) diff --git a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py index 3eb2c6158..d989804fb 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py +++ b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py @@ -1452,6 +1452,14 @@ class TestOvsNeutronAgent(object): self.agent._setup_tunnel_port(bridge, 1, 2, tunnel_type=tunnel_type) self.assertIn('bar', self.agent.local_vlan_map) + def test_setup_entry_for_arp_reply_ignores_ipv6_addresses(self): + self.agent.arp_responder_enabled = True + ip = '2001:db8::1' + br = mock.Mock() + self.agent.setup_entry_for_arp_reply( + br, 'add', mock.Mock(), mock.Mock(), ip) + self.assertFalse(br.install_arp_responder.called) + class TestOvsNeutronAgentOFCtl(TestOvsNeutronAgent, ovs_test_base.OVSOFCtlTestBase):