station: Ignore ad-hoc networks in scan results

If there are Ad-hoc BSSes they should be present in the scan results
together with regular APs as far as scan.c is concerned.  But in
station mode we can't connect to them -- the Connect method will fail and
autoconnect would fail.  Since we have no property to indicate a
network is an IBSS just filter these results out for now.  There are
perhaps better solutions but the benefit is very low.
This commit is contained in:
Andrew Zaborowski 2018-10-03 23:37:44 +02:00 committed by Denis Kenzior
parent dc87830aac
commit 6e70c84f8e
2 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,6 @@ typedef void (*scan_freq_set_func_t)(uint32_t freq, void *userdata);
struct scan_freq_set;
struct ie_rsn_info;
enum ie_bss_capability;
struct scan_bss {
uint8_t addr[6];

View File

@ -264,6 +264,11 @@ static struct network *station_add_seen_bss(struct station *station,
memcpy(ssid, bss->ssid, bss->ssid_len);
ssid[bss->ssid_len] = '\0';
if (!(bss->capability & IE_BSS_CAP_ESS)) {
l_debug("Ignoring non-ESS BSS \"%s\"", ssid);
return NULL;
}
memset(&info, 0, sizeof(info));
r = scan_bss_get_rsn_info(bss, &info);
if (r < 0) {