mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-26 13:49:35 -05:00
Clean up AP-STA-CONNECTED/DISCONNECTED prints
Use shared code to print the parameters so that they do not need to be generated four times separately. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
92c4465b75
commit
7793c959e6
@ -855,6 +855,7 @@ void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
|||||||
int authorized)
|
int authorized)
|
||||||
{
|
{
|
||||||
const u8 *dev_addr = NULL;
|
const u8 *dev_addr = NULL;
|
||||||
|
char buf[100];
|
||||||
#ifdef CONFIG_P2P
|
#ifdef CONFIG_P2P
|
||||||
u8 addr[ETH_ALEN];
|
u8 addr[ETH_ALEN];
|
||||||
#endif /* CONFIG_P2P */
|
#endif /* CONFIG_P2P */
|
||||||
@ -871,44 +872,29 @@ void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
|||||||
dev_addr = p2p_group_get_dev_addr(hapd->p2p_group, sta->addr);
|
dev_addr = p2p_group_get_dev_addr(hapd->p2p_group, sta->addr);
|
||||||
#endif /* CONFIG_P2P */
|
#endif /* CONFIG_P2P */
|
||||||
|
|
||||||
|
if (dev_addr)
|
||||||
|
os_snprintf(buf, sizeof(buf), MACSTR " p2p_dev_addr=" MACSTR,
|
||||||
|
MAC2STR(sta->addr), MAC2STR(dev_addr));
|
||||||
|
else
|
||||||
|
os_snprintf(buf, sizeof(buf), MACSTR, MAC2STR(sta->addr));
|
||||||
|
|
||||||
if (authorized) {
|
if (authorized) {
|
||||||
if (dev_addr)
|
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s", buf);
|
||||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED
|
|
||||||
MACSTR " p2p_dev_addr=" MACSTR,
|
|
||||||
MAC2STR(sta->addr), MAC2STR(dev_addr));
|
|
||||||
else
|
|
||||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED
|
|
||||||
MACSTR, MAC2STR(sta->addr));
|
|
||||||
if (hapd->msg_ctx_parent &&
|
if (hapd->msg_ctx_parent &&
|
||||||
hapd->msg_ctx_parent != hapd->msg_ctx && dev_addr)
|
hapd->msg_ctx_parent != hapd->msg_ctx)
|
||||||
wpa_msg(hapd->msg_ctx_parent, MSG_INFO,
|
wpa_msg(hapd->msg_ctx_parent, MSG_INFO,
|
||||||
AP_STA_CONNECTED MACSTR " p2p_dev_addr="
|
AP_STA_CONNECTED "%s", buf);
|
||||||
MACSTR,
|
|
||||||
MAC2STR(sta->addr), MAC2STR(dev_addr));
|
|
||||||
else if (hapd->msg_ctx_parent &&
|
|
||||||
hapd->msg_ctx_parent != hapd->msg_ctx)
|
|
||||||
wpa_msg(hapd->msg_ctx_parent, MSG_INFO,
|
|
||||||
AP_STA_CONNECTED MACSTR, MAC2STR(sta->addr));
|
|
||||||
|
|
||||||
sta->flags |= WLAN_STA_AUTHORIZED;
|
sta->flags |= WLAN_STA_AUTHORIZED;
|
||||||
} else {
|
} else {
|
||||||
if (dev_addr)
|
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf);
|
||||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED
|
|
||||||
MACSTR " p2p_dev_addr=" MACSTR,
|
|
||||||
MAC2STR(sta->addr), MAC2STR(dev_addr));
|
|
||||||
else
|
|
||||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED
|
|
||||||
MACSTR, MAC2STR(sta->addr));
|
|
||||||
if (hapd->msg_ctx_parent &&
|
if (hapd->msg_ctx_parent &&
|
||||||
hapd->msg_ctx_parent != hapd->msg_ctx && dev_addr)
|
hapd->msg_ctx_parent != hapd->msg_ctx)
|
||||||
wpa_msg(hapd->msg_ctx_parent, MSG_INFO,
|
wpa_msg(hapd->msg_ctx_parent, MSG_INFO,
|
||||||
AP_STA_DISCONNECTED MACSTR " p2p_dev_addr="
|
AP_STA_DISCONNECTED "%s", buf);
|
||||||
MACSTR, MAC2STR(sta->addr), MAC2STR(dev_addr));
|
|
||||||
else if (hapd->msg_ctx_parent &&
|
|
||||||
hapd->msg_ctx_parent != hapd->msg_ctx)
|
|
||||||
wpa_msg(hapd->msg_ctx_parent, MSG_INFO,
|
|
||||||
AP_STA_DISCONNECTED MACSTR,
|
|
||||||
MAC2STR(sta->addr));
|
|
||||||
sta->flags &= ~WLAN_STA_AUTHORIZED;
|
sta->flags &= ~WLAN_STA_AUTHORIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user