]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
ovs: don't use ARP responder for IPv6 addresses
authorIhar Hrachyshka <ihrachys@redhat.com>
Fri, 11 Sep 2015 18:46:51 +0000 (14:46 -0400)
committerAssaf Muller <amuller@redhat.com>
Fri, 11 Sep 2015 18:49:30 +0000 (14:49 -0400)
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 <Thomas.Carroll@pnnl.gov>
Closes-Bug: #1477253

neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py

index f88a0130197a3e7616f3749290c12b976ad3cf0f..f20c013f8ce60dcbb56fea8fad4b9615c9ee0731 100644 (file)
@@ -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)
index 3eb2c61583ea6594fdffe97d8fcae130b29ac46e..d989804fb58e0ae5c530ac762954ccf164468115 100644 (file)
@@ -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):