Skip to content
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 8 additions & 23 deletions src/utils/ubus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,6 @@ void del_client_all_interfaces(const struct dawn_mac client_addr, uint32_t reaso
}

void del_client_interface(uint32_t id, const struct dawn_mac client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time) {
struct hostapd_sock_entry *sub;
struct blob_buf b = {0};

blob_buf_init(&b, 0);
Expand All @@ -1247,20 +1246,14 @@ void del_client_interface(uint32_t id, const struct dawn_mac client_addr, uint32
blobmsg_add_u8(&b, "deauth", deauth);
blobmsg_add_u32(&b, "ban_time", ban_time);

int timeout = 1;
ubus_invoke(ctx, id, "del_client", b.head, NULL, NULL, timeout * 1000);

list_for_each_entry(sub, &hostapd_sock_list, list)
{
if (sub->subscribed) {
int timeout = 1;
ubus_invoke(ctx, id, "del_client", b.head, NULL, NULL, timeout * 1000);
}
}
blob_buf_free(&b);
dawn_unregmem(&b);
}

int bss_transition_request(uint32_t id, const struct dawn_mac client_addr, struct kicking_nr* neighbor_list, uint32_t duration) {
struct hostapd_sock_entry* sub;
struct blob_buf b = { 0 };

dawnlog_debug_func("Entering...");
Expand All @@ -1285,12 +1278,10 @@ int bss_transition_request(uint32_t id, const struct dawn_mac client_addr, struc
}

blobmsg_close_array(&b, nbs);
list_for_each_entry(sub, &hostapd_sock_list, list)
{
if (sub->subscribed) {
int timeout = 1; //TDO: Maybe ID is wrong?! OR CHECK HERE ID
ubus_invoke(ctx, id, "bss_transition_request", b.head, NULL, NULL, timeout * 1000);
}
// do not ask to leave without providing candidates, unless NR explicitly disabled or unavailable (consider empty rrm_mode)
if (neighbors_added || (dawn_metric.disassoc_nr_length <= 0) || (dawn_metric.set_hostapd_nr <= 0) || (timeout_config.update_beacon_reports <= 0) ) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if update_beacon_reports condition shouldn't be coupled with set_hostapd_nr == 2, so that:

set_hostapd_nr '1'
update_beacon_reports '0'

with empty ap_nr_list won't spam either. I.e.

if (neighbors_added
    || (dawn_metric.disassoc_nr_length <= 0) || (dawn_metric.set_hostapd_nr <= 0)
    || ((timeout_config.update_beacon_reports <= 0) && (dawn_metric.set_hostapd_nr == 2)) ) {

int timeout = 1;
ubus_invoke(ctx, id, "bss_transition_request", b.head, NULL, NULL, timeout * 1000);
}

blob_buf_free(&b);
Expand All @@ -1300,7 +1291,6 @@ int bss_transition_request(uint32_t id, const struct dawn_mac client_addr, struc
}

int wnm_disassoc_imminent(uint32_t id, const struct dawn_mac client_addr, struct kicking_nr* neighbor_list, int threshold, uint32_t duration) {
struct hostapd_sock_entry *sub;
struct blob_buf b = {0};

dawnlog_debug_func("Entering...");
Expand All @@ -1325,13 +1315,8 @@ int wnm_disassoc_imminent(uint32_t id, const struct dawn_mac client_addr, struct
}

blobmsg_close_array(&b, nbs);
list_for_each_entry(sub, &hostapd_sock_list, list)
{
if (sub->subscribed) {
int timeout = 1; //TDO: Maybe ID is wrong?! OR CHECK HERE ID
ubus_invoke(ctx, id, "bss_transition_request", b.head, NULL, NULL, timeout * 1000);
}
}
int timeout = 1;
ubus_invoke(ctx, id, "bss_transition_request", b.head, NULL, NULL, timeout * 1000);

blob_buf_free(&b);
dawn_unregmem(&b);
Expand Down