tests: proxyarp_errors: Sync carrier before sending frame

Similar to other cases before, this may end up trying to
send the frame before the carrier state is ready. Ensure
it's ready before sending the frame.

To do that, rename the sync_carrier() function and make
the ifname argument optional.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2024-01-24 17:12:49 +01:00 committed by Jouni Malinen
parent b7ed69206d
commit bf26920792
2 changed files with 4 additions and 3 deletions

View file

@ -11,7 +11,7 @@ logger = logging.getLogger()
from wpasupplicant import WpaSupplicant from wpasupplicant import WpaSupplicant
def _sync_carrier(dev, ifname): def sync_carrier(dev, ifname=None):
ifname = ifname or dev.ifname ifname = ifname or dev.ifname
carrier_p2p = None carrier_p2p = None
try: try:
@ -40,7 +40,7 @@ def config_data_test(dev1, dev2, dev1group, dev2group, ifname1, ifname2):
if "OK" not in res: if "OK" not in res:
raise Exception("Failed to enable data test functionality") raise Exception("Failed to enable data test functionality")
_sync_carrier(dev1, ifname1) sync_carrier(dev1, ifname1)
cmd = "DATA_TEST_CONFIG 1" cmd = "DATA_TEST_CONFIG 1"
if ifname2: if ifname2:
@ -52,7 +52,7 @@ def config_data_test(dev1, dev2, dev1group, dev2group, ifname1, ifname2):
if "OK" not in res: if "OK" not in res:
raise Exception("Failed to enable data test functionality") raise Exception("Failed to enable data test functionality")
_sync_carrier(dev2, ifname2) sync_carrier(dev2, ifname2)
def run_multicast_connectivity_test(dev1, dev2, tos=None, def run_multicast_connectivity_test(dev1, dev2, tos=None,
dev1group=False, dev2group=False, dev1group=False, dev2group=False,

View file

@ -5483,6 +5483,7 @@ def run_proxyarp_errors(dev, apdev, params):
pkt = build_ns(src_ll=addr0, ip_src="aaaa:bbbb:cccc::2", pkt = build_ns(src_ll=addr0, ip_src="aaaa:bbbb:cccc::2",
ip_dst="ff02::1:ff00:2", target="aaaa:bbbb:cccc::2", ip_dst="ff02::1:ff00:2", target="aaaa:bbbb:cccc::2",
opt=src_ll_opt0) opt=src_ll_opt0)
hwsim_utils.sync_carrier(dev[0])
if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()):
raise Exception("DATA_TEST_FRAME failed") raise Exception("DATA_TEST_FRAME failed")
wait_fail_trigger(hapd, "GET_ALLOC_FAIL") wait_fail_trigger(hapd, "GET_ALLOC_FAIL")