diff --git a/wifimngr_wifi.c b/wifimngr_wifi.c index 038a7d53513957851dcfccb4d45e81c98f1bbb62..ddb206143b69cdfc32a7a0f8764d268a26903537 100644 --- a/wifimngr_wifi.c +++ b/wifimngr_wifi.c @@ -66,10 +66,16 @@ int wifimngr_wifi_nbr_list(struct blob_buf *bb, char *ifname, bool wildcard) void *a, *t; char bssid_str[18] = {0}; int i; + int channel = 0; + int band = -1; if (wifi_get_neighbor_list(ifname, &nbr, &nr) < 0) return -1; + wifi_get_channel(ifname, &channel); + if (channel != 0) + band = channel >= 36 ? 1 : 0; + if (!wildcard) a = blobmsg_open_array(bb, "neighbors"); @@ -77,6 +83,14 @@ int wifimngr_wifi_nbr_list(struct blob_buf *bb, char *ifname, bool wildcard) struct nbr *e; e = nbr + i; + + /* ugly workaround to make sure that BSSs from the other + * band do not get listed. + */ + if ((band == 1 && e->channel < 36) || + (band == 0 && channel >= 36)) + continue; + t = blobmsg_open_table(bb, ""); sprintf(bssid_str, "%02X:%02X:%02X:%02X:%02X:%02X", e->bssid[0], e->bssid[1], e->bssid[2],