Add ap_isolate configuration option for wpa_supplicant AP mode

Allow client isolation to be configured with ap_isolate inside
wpa_supplicant configuration file.

Signed-off-by: Danilo Ravotto <danilo.ravotto@zirak.it>
This commit is contained in:
Danilo Ravotto 2018-02-01 12:09:38 +01:00 committed by Jouni Malinen
parent e51e49fccc
commit 19e20c14fb
6 changed files with 26 additions and 2 deletions

View File

@ -506,6 +506,9 @@ no_wps:
else
bss->max_num_sta = wpa_s->conf->max_num_sta;
if (!bss->isolate)
bss->isolate = wpa_s->conf->ap_isolate;
bss->disassoc_low_ack = wpa_s->conf->disassoc_low_ack;
if (wpa_s->conf->ap_vendor_elements) {

View File

@ -3899,6 +3899,7 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
config->bss_expiration_age = DEFAULT_BSS_EXPIRATION_AGE;
config->bss_expiration_scan_count = DEFAULT_BSS_EXPIRATION_SCAN_COUNT;
config->max_num_sta = DEFAULT_MAX_NUM_STA;
config->ap_isolate = DEFAULT_AP_ISOLATE;
config->access_network_type = DEFAULT_ACCESS_NETWORK_TYPE;
config->scan_cur_freq = DEFAULT_SCAN_CUR_FREQ;
config->wmm_ac_params[0] = ac_be;
@ -4578,6 +4579,7 @@ static const struct global_parse_data global_fields[] = {
{ INT_RANGE(filter_ssids, 0, 1), 0 },
{ INT_RANGE(filter_rssi, -100, 0), 0 },
{ INT(max_num_sta), 0 },
{ INT_RANGE(ap_isolate, 0, 1), 0 },
{ INT_RANGE(disassoc_low_ack, 0, 1), 0 },
#ifdef CONFIG_HS20
{ INT_RANGE(hs20, 0, 1), 0 },

View File

@ -32,6 +32,7 @@
#define DEFAULT_BSS_EXPIRATION_AGE 180
#define DEFAULT_BSS_EXPIRATION_SCAN_COUNT 2
#define DEFAULT_MAX_NUM_STA 128
#define DEFAULT_AP_ISOLATE 0
#define DEFAULT_ACCESS_NETWORK_TYPE 15
#define DEFAULT_SCAN_CUR_FREQ 0
#define DEFAULT_P2P_SEARCH_DELAY 500
@ -842,6 +843,20 @@ struct wpa_config {
*/
unsigned int max_num_sta;
/**
* ap_isolate - Whether to use client isolation feature
*
* Client isolation can be used to prevent low-level bridging of
* frames between associated stations in the BSS. By default,
* this bridging is allowed (ap_isolate=0); except in P2P GO case,
* where p2p_intra_bss parameter is used to determine whether to allow
* intra-BSS forwarding (ap_isolate = !p2p_intra_bss).
*
* 0 = do not enable AP isolation
* 1 = enable AP isolation
*/
int ap_isolate;
/**
* freq_list - Array of allowed scan frequencies or %NULL for all
*

View File

@ -1282,6 +1282,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
fprintf(f, "filter_rssi=%d\n", config->filter_rssi);
if (config->max_num_sta != DEFAULT_MAX_NUM_STA)
fprintf(f, "max_num_sta=%u\n", config->max_num_sta);
if (config->ap_isolate != DEFAULT_AP_ISOLATE)
fprintf(f, "ap_isolate=%u\n", config->ap_isolate);
if (config->disassoc_low_ack)
fprintf(f, "disassoc_low_ack=%d\n", config->disassoc_low_ack);
#ifdef CONFIG_HS20

View File

@ -619,6 +619,8 @@ static int wpa_config_write_global(struct wpa_config *config, HKEY hk)
config->filter_ssids, 0);
wpa_config_write_reg_dword(hk, TEXT("max_num_sta"),
config->max_num_sta, DEFAULT_MAX_NUM_STA);
wpa_config_write_reg_dword(hk, TEXT("ap_isolate"),
config->ap_isolate, DEFAULT_AP_ISOLATE);
wpa_config_write_reg_dword(hk, TEXT("disassoc_low_ack"),
config->disassoc_low_ack, 0);

View File

@ -476,7 +476,7 @@ static char ** wpa_cli_complete_set(const char *str, int pos)
#endif /* CONFIG_P2P */
"country", "bss_max_count", "bss_expiration_age",
"bss_expiration_scan_count", "filter_ssids", "filter_rssi",
"max_num_sta", "disassoc_low_ack",
"max_num_sta", "disassoc_low_ack", "ap_isolate",
#ifdef CONFIG_HS20
"hs20",
#endif /* CONFIG_HS20 */
@ -573,7 +573,7 @@ static char ** wpa_cli_complete_get(const char *str, int pos)
#endif /* CONFIG_P2P */
"bss_max_count", "bss_expiration_age",
"bss_expiration_scan_count", "filter_ssids", "filter_rssi",
"max_num_sta", "disassoc_low_ack",
"max_num_sta", "disassoc_low_ack", "ap_isolate",
#ifdef CONFIG_HS20
"hs20",
#endif /* CONFIG_HS20 */