#include "common/ieee802_11_defs.h"
#include "drivers/driver.h"
#include "wpa_supplicant_i.h"
+#include "config.h"
#include "notify.h"
#include "scan.h"
#include "bss.h"
-#ifndef WPA_BSS_MAX_COUNT
-#define WPA_BSS_MAX_COUNT 200
-#endif /* WPA_BSS_MAX_COUNT */
-
/**
* WPA_BSS_EXPIRATION_PERIOD - Period of expiration run in seconds
*/
wpa_printf(MSG_DEBUG, "BSS: Add new id %u BSSID " MACSTR " SSID '%s'",
bss->id, MAC2STR(bss->bssid), wpa_ssid_txt(ssid, ssid_len));
wpas_notify_bss_added(wpa_s, bss->bssid, bss->id);
- if (wpa_s->num_bss > WPA_BSS_MAX_COUNT) {
+ if (wpa_s->num_bss > wpa_s->conf->bss_max_count) {
/* Remove the oldest entry */
wpa_bss_remove(wpa_s, dl_list_first(&wpa_s->bss,
struct wpa_bss, list));
config->eapol_version = DEFAULT_EAPOL_VERSION;
config->ap_scan = DEFAULT_AP_SCAN;
config->fast_reauth = DEFAULT_FAST_REAUTH;
+ config->bss_max_count = DEFAULT_BSS_MAX_COUNT;
if (ctrl_interface)
config->ctrl_interface = os_strdup(ctrl_interface);
#define DEFAULT_AP_SCAN 1
#endif /* CONFIG_NO_SCAN_PROCESSING */
#define DEFAULT_FAST_REAUTH 1
+#define DEFAULT_BSS_MAX_COUNT 200
#include "config_ssid.h"
* ctrl_iface to external program(s)
*/
int wps_cred_processing;
+
+ /**
+ * bss_max_count - Maximum number of BSS entries to keep in memory
+ */
+ unsigned int bss_max_count;
};
{ STR(config_methods) },
{ INT_RANGE(wps_cred_processing, 0, 2) },
#endif /* CONFIG_WPS */
- { FUNC(country) }
+ { FUNC(country) },
+ { INT(bss_max_count) }
};
#undef FUNC
fprintf(f, "country=%c%c\n",
config->country[0], config->country[1]);
}
+ if (config->bss_max_count != DEFAULT_BSS_MAX_COUNT)
+ fprintf(f, "bss_max_count=%u\n", config->bss_max_count);
}
#endif /* CONFIG_NO_CONFIG_WRITE */
&config->wps_cred_processing);
#endif /* CONFIG_WPS */
+ wpa_config_read_reg_dword(hk, TEXT("bss_max_count"),
+ &config->bss_max_count);
+
return errors ? -1 : 0;
}
config->wps_cred_processing, 0);
#endif /* CONFIG_WPS */
+ wpa_config_write_reg_dword(hk, TEXT("bss_max_count"),
+ config->bss_max_count,
+ DEFAULT_BSS_MAX_COUNT);
+
return 0;
}
# to external program(s)
#wps_cred_processing=0
+# Maximum number of BSS entries to keep in memory
+# Default: 200
+# This can be used to limit memory use on the BSS entries (cached scan
+# results). A larger value may be needed in environments that have huge number
+# of APs when using ap_scan=1 mode.
+#bss_max_count=200
+
+
# network block
#
# Each network (usually AP's sharing the same SSID) is configured as a separate