Get rid of manual ARP hack in TDLSPing

Instead of plugging in an IP address manually in the TDLSPing
test, set the proper kernel parameters in the interface so the
AP no longer responds to ARP requests for the peer.  This will
be useful to allow us to properly validate that ARP requests
work when TDLS operations are performed against IP addresses.
There's no need to reset these values when the test ends or
starts, since all the devices involved are removed every time
the test starts, and when they get created they return to their
default state.

BUG=chromium:326518
TEST=This is a test

Change-Id: Ia7a11027596bc3b581203e3e211da497f9a3b1fb
Reviewed-on: https://chromium-review.googlesource.com/179271
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
diff --git a/server/site_linux_router.py b/server/site_linux_router.py
index dacc21f..8cfd4d3 100644
--- a/server/site_linux_router.py
+++ b/server/site_linux_router.py
@@ -979,6 +979,14 @@
         self.router.run('echo 2 > /proc/sys/net/ipv4/conf/%s/rp_filter' %
                         interface)
 
+        # Similarly, we'd like to prevent the hostap interface from
+        # replying to ARP requests for the peer IP address and vice
+        # versa.
+        self.router.run('echo 1 > /proc/sys/net/ipv4/conf/%s/arp_ignore' %
+                        interface)
+        self.router.run('echo 1 > /proc/sys/net/ipv4/conf/%s/arp_ignore' %
+                        hostap_conf['interface'])
+
         self.station['configured'] = True
         self.station['type'] = 'supplicant'
         self.station['interface'] = interface
diff --git a/server/site_tests/network_WiFi_TDLSPing/network_WiFi_TDLSPing.py b/server/site_tests/network_WiFi_TDLSPing/network_WiFi_TDLSPing.py
index d553673..76b15f4 100644
--- a/server/site_tests/network_WiFi_TDLSPing/network_WiFi_TDLSPing.py
+++ b/server/site_tests/network_WiFi_TDLSPing/network_WiFi_TDLSPing.py
@@ -118,18 +118,11 @@
         # it can send TDLS traffic.
         self.context.router.add_connected_peer()
 
-        # Manually add an ARP entry for the peer device in the DUT.
-        # Because the AP is the same machine as the peer, it will
-        # reply to ARP requests for the peer with the AP MAC address,
-        # which is not what we want the DUT to use.
-        peer_ip = self.context.router.local_peer_ip_address(0)
-        peer_mac = self.context.router.local_peer_mac_address()
-        self.context.client.add_arp_entry(peer_ip, peer_mac)
-
         # Ping from DUT to the associated peer without TDLS.
         self.ping_and_check_for_tdls(frequency, expected=False)
 
         # Ping from DUT to the associated peer with TDLS.
+        peer_mac = self.context.router.local_peer_mac_address()
         self.context.client.establish_tdls_link(peer_mac)
         self.ping_and_check_for_tdls(frequency, expected=True)