From b0621b083d714f816a0760be97f985e4d34b2c67 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 29 Dec 2019 23:24:10 +0200 Subject: [PATCH] Call hostapd_allowed_address() directly from handle_probe_req() ieee802_11_allowed_address() did not really do anything useful for the call from handle_probe_req(), so replace that with a direct call to hostapd_allowed_address() and make ieee802_11_allowed_address() a static function. Signed-off-by: Jouni Malinen --- src/ap/beacon.c | 4 ++-- src/ap/ieee802_11.c | 22 ++++++++++------------ src/ap/ieee802_11.h | 3 --- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 5a3249f20..f3f496ba9 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -764,8 +764,8 @@ void handle_probe_req(struct hostapd_data *hapd, sta_track_add(hapd->iface, mgmt->sa, ssi_signal); ie_len = len - IEEE80211_HDRLEN; - ret = ieee802_11_allowed_address(hapd, mgmt->sa, (const u8 *) mgmt, len, - &rad_info, 1); + ret = hostapd_allowed_address(hapd, mgmt->sa, (const u8 *) mgmt, len, + &rad_info, 1); if (ret == HOSTAPD_ACL_REJECT) { wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Ignore Probe Request frame from " MACSTR diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index ef1078ff0..0fb2ec116 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -2050,20 +2050,18 @@ void ieee802_11_finish_fils_auth(struct hostapd_data *hapd, #endif /* CONFIG_FILS */ -int ieee802_11_allowed_address(struct hostapd_data *hapd, const u8 *addr, - const u8 *msg, size_t len, - struct radius_sta *info, int is_probe_req) +static int ieee802_11_allowed_address(struct hostapd_data *hapd, const u8 *addr, + const u8 *msg, size_t len, + struct radius_sta *info) { int res; - res = hostapd_allowed_address(hapd, addr, msg, len, info, is_probe_req); + res = hostapd_allowed_address(hapd, addr, msg, len, info, 0); if (res == HOSTAPD_ACL_REJECT) { - if (!is_probe_req) - wpa_printf(MSG_DEBUG, - "Station " MACSTR - " not allowed to authenticate", - MAC2STR(addr)); + wpa_printf(MSG_DEBUG, "Station " MACSTR + " not allowed to authenticate", + MAC2STR(addr)); return HOSTAPD_ACL_REJECT; } @@ -2305,8 +2303,8 @@ static void handle_auth(struct hostapd_data *hapd, } } - res = ieee802_11_allowed_address( - hapd, mgmt->sa, (const u8 *) mgmt, len, &rad_info, 0); + res = ieee802_11_allowed_address(hapd, mgmt->sa, (const u8 *) mgmt, len, + &rad_info); if (res == HOSTAPD_ACL_REJECT) { wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Ignore Authentication frame from " MACSTR @@ -4065,7 +4063,7 @@ static void handle_assoc(struct hostapd_data *hapd, acl_res = ieee802_11_allowed_address(hapd, mgmt->sa, (const u8 *) mgmt, - len, &info, 0); + len, &info); if (acl_res == HOSTAPD_ACL_REJECT) { wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Ignore Association Request frame from " diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h index b85105edd..0983d4c8b 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h @@ -179,9 +179,6 @@ void handle_auth_fils(struct hostapd_data *hapd, struct sta_info *sta, size_t hostapd_eid_owe_trans_len(struct hostapd_data *hapd); u8 * hostapd_eid_owe_trans(struct hostapd_data *hapd, u8 *eid, size_t len); -int ieee802_11_allowed_address(struct hostapd_data *hapd, const u8 *addr, - const u8 *msg, size_t len, - struct radius_sta *info, int is_probe_req); int get_tx_parameters(struct sta_info *sta, int ap_max_chanwidth, int ap_seg1_idx, int *bandwidth, int *seg1_idx);