Browse Source

tests: Fix proxyarp_open IPv4-from-bridge

There were couple of typos in the IP addresses and there was no coverage
for the normal unicast ARP response from the bridge (since non-wireless
device does not get proxied by the AP). In addition, it is better to
change the IP address used here to be unique to make the sniffer logs
easier to interpret.

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 10 years ago
parent
commit
89cd4355bb
1 changed files with 12 additions and 9 deletions
  1. 12 9
      tests/hwsim/test_ap_hs20.py

+ 12 - 9
tests/hwsim/test_ap_hs20.py

@@ -2787,7 +2787,7 @@ def send_arp(dev, dst_ll="ff:ff:ff:ff:ff:ff", src_ll=None, opcode=1,
             sender_mac = dev.p2p_interface_addr()
             sender_mac = dev.p2p_interface_addr()
         cmd = "DATA_TEST_FRAME "
         cmd = "DATA_TEST_FRAME "
 
 
-    pkt = build_arp(dst_ll="ff:ff:ff:ff:ff:ff", src_ll=src_ll, opcode=opcode,
+    pkt = build_arp(dst_ll=dst_ll, src_ll=src_ll, opcode=opcode,
                     sender_mac=sender_mac, sender_ip=sender_ip,
                     sender_mac=sender_mac, sender_ip=sender_ip,
                     target_mac=target_mac, target_ip=target_ip)
                     target_mac=target_mac, target_ip=target_ip)
     if "OK" not in dev.request(cmd + binascii.hexlify(pkt)):
     if "OK" not in dev.request(cmd + binascii.hexlify(pkt)):
@@ -2998,22 +2998,25 @@ def _test_proxyarp_open(dev, apdev, params):
              target_ip="192.168.1.127")
              target_ip="192.168.1.127")
 
 
     # ARP Probe from bridge
     # ARP Probe from bridge
-    send_arp(hapd, hapd_bssid=bssid, target_ip="192.168.1.128")
-    # ARP Announcement from bridge
-    send_arp(hapd, hapd_bssid=bssid, sender_ip="129.168.1.128",
-             target_ip="192.168.1.128")
-    send_arp(hapd, hapd_bssid=bssid, sender_ip="129.168.1.128",
-             target_ip="192.168.1.128", opcode=2)
+    send_arp(hapd, hapd_bssid=bssid, target_ip="192.168.1.130")
+    # ARP Announcement from bridge (not to be learned by AP for proxyarp)
+    send_arp(hapd, hapd_bssid=bssid, sender_ip="192.168.1.130",
+             target_ip="192.168.1.130")
+    send_arp(hapd, hapd_bssid=bssid, sender_ip="192.168.1.130",
+             target_ip="192.168.1.130", opcode=2)
 
 
     matches = get_permanent_neighbors("ap-br0")
     matches = get_permanent_neighbors("ap-br0")
     logger.info("After ARP Probe + Announcement: " + str(matches))
     logger.info("After ARP Probe + Announcement: " + str(matches))
 
 
     # ARP Request for the newly introduced IP address from wireless STA
     # ARP Request for the newly introduced IP address from wireless STA
-    send_arp(dev[0], sender_ip="192.168.1.123", target_ip="192.168.1.128")
+    send_arp(dev[0], sender_ip="192.168.1.123", target_ip="192.168.1.130")
+    # ARP Response from bridge (AP does not proxy for non-wireless devices)
+    send_arp(hapd, hapd_bssid=bssid, dst_ll=addr0, sender_ip="192.168.1.130",
+             target_ip="192.168.1.123", opcode=2)
 
 
     # ARP Request for the newly introduced IP address from bridge
     # ARP Request for the newly introduced IP address from bridge
     send_arp(hapd, hapd_bssid=bssid, sender_ip="192.168.1.102",
     send_arp(hapd, hapd_bssid=bssid, sender_ip="192.168.1.102",
-             target_ip="192.168.1.128")
+             target_ip="192.168.1.130")
 
 
     # ARP Probe from wireless STA (duplicate address; learned through DHCP)
     # ARP Probe from wireless STA (duplicate address; learned through DHCP)
     send_arp(dev[1], target_ip="192.168.1.123")
     send_arp(dev[1], target_ip="192.168.1.123")