From 89cd4355bbffbd2b35446a7ccf67c264ffdbf639 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 17 Dec 2014 00:41:18 +0200 Subject: [PATCH] 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 --- tests/hwsim/test_ap_hs20.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 5b01a9a59..7f24748a6 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/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() 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, target_mac=target_mac, target_ip=target_ip) 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") # 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") logger.info("After ARP Probe + Announcement: " + str(matches)) # 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 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) send_arp(dev[1], target_ip="192.168.1.123")