Add return value to ACL functions
While these do not return error code within the current hostapd implementation, matching functions in wpa_supplicant AP functionality will have an error case and using consistent return type will make the control interface code more consistent. In addition, export hostapd_set_acl() in preparation for the wpa_supplicant control interface implementation extension. Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
This commit is contained in:
parent
f5ac428116
commit
fd0d738ff4
4 changed files with 17 additions and 10 deletions
|
@ -1458,14 +1458,14 @@ static int hostapd_set_acl_list(struct hostapd_data *hapd,
|
|||
}
|
||||
|
||||
|
||||
static void hostapd_set_acl(struct hostapd_data *hapd)
|
||||
int hostapd_set_acl(struct hostapd_data *hapd)
|
||||
{
|
||||
struct hostapd_config *conf = hapd->iconf;
|
||||
int err;
|
||||
int err = 0;
|
||||
u8 accept_acl;
|
||||
|
||||
if (hapd->iface->drv_max_acl_mac_addrs == 0)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
if (conf->bss[0]->macaddr_acl == DENY_UNLESS_ACCEPTED) {
|
||||
accept_acl = 1;
|
||||
|
@ -1474,7 +1474,7 @@ static void hostapd_set_acl(struct hostapd_data *hapd)
|
|||
accept_acl);
|
||||
if (err) {
|
||||
wpa_printf(MSG_DEBUG, "Failed to set accept acl");
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
} else if (conf->bss[0]->macaddr_acl == ACCEPT_UNLESS_DENIED) {
|
||||
accept_acl = 0;
|
||||
|
@ -1483,9 +1483,10 @@ static void hostapd_set_acl(struct hostapd_data *hapd)
|
|||
accept_acl);
|
||||
if (err) {
|
||||
wpa_printf(MSG_DEBUG, "Failed to set deny acl");
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue