From 7bf79a237c4eaf68fa9211fbf1d1c083fa749c91 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Mon, 18 Oct 2021 13:30:18 +0200 Subject: [PATCH] ubus: set scan duration to roam scan interval Some clients seem to ignore scan requests with unreasonably high measurement durations. This was observed with a Google Pixel 4A as well as a Xiaomi Mi 10T. Advertise a scan duration which closely matches the roam scan-interval. This triggers scans more reliably with the aformentioned devices. Signed-off-by: David Bauer --- ubus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubus.c b/ubus.c index fabc1a6..7b4ce10 100644 --- a/ubus.c +++ b/ubus.c @@ -557,7 +557,7 @@ int usteer_ubus_trigger_client_scan(struct sta_info *si) blob_buf_init(&b, 0); blobmsg_printf(&b, "addr", MAC_ADDR_FMT, MAC_ADDR_DATA(si->sta->addr)); blobmsg_add_u32(&b, "mode", BEACON_MEASUREMENT_ACTIVE); - blobmsg_add_u32(&b, "duration", 65535); + blobmsg_add_u32(&b, "duration", config.roam_scan_interval / 100); blobmsg_add_u32(&b, "channel", 0); blobmsg_add_u32(&b, "op_class", si->scan_band ? 1 : 12); return ubus_invoke(ubus_ctx, ln->obj_id, "rrm_beacon_req", b.head, NULL, 0, 100); -- 2.30.2