From 2bfd7397e1ad2a814a0aa4b38d66b2bbba79f5ba Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 9 May 2022 16:21:06 +0300 Subject: [PATCH] ubus: use bss_transition_request OpenWrt's hostapd now supports the more generic "bss_transition_request" method that allows initiating a BSS transition request with the Disassociation Imminent bit not set. Use this new method instead of "wnm_disassoc_imminent" so that the old method can be removed. Signed-off-by: Stijn Tintel --- src/utils/ubus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/ubus.c b/src/utils/ubus.c index 9eb79c5..cc89f59 100644 --- a/src/utils/ubus.c +++ b/src/utils/ubus.c @@ -1124,7 +1124,9 @@ int wnm_disassoc_imminent(uint32_t id, const struct dawn_mac client_addr, struct blob_buf_init(&b, 0); dawn_regmem(&b); blobmsg_add_macaddr(&b, "addr", client_addr); - blobmsg_add_u32(&b, "duration", duration); + blobmsg_add_u8(&b, "disassociation_imminent", 1); + blobmsg_add_u32(&b, "disassociation_timer", duration); + blobmsg_add_u32(&b, "validity_period", duration); blobmsg_add_u8(&b, "abridged", 1); // prefer aps in neighborlist void* nbs = blobmsg_open_array(&b, "neighbors"); @@ -1139,7 +1141,7 @@ int wnm_disassoc_imminent(uint32_t id, const struct dawn_mac client_addr, struct { if (sub->subscribed) { int timeout = 1; //TDO: Maybe ID is wrong?! OR CHECK HERE ID - ubus_invoke(ctx, id, "wnm_disassoc_imminent", b.head, NULL, NULL, timeout * 1000); + ubus_invoke(ctx, id, "bss_transition_request", b.head, NULL, NULL, timeout * 1000); } }