P2P: Append P2P Device Address to AP-STA-CONNECTED event
For P2P, the p2p_connect takes in device address argument to make a connection. However the connected event AP-STA-CONNECTED comes with interface address. The application listening on events would find it difficult to map interface address to the p2p device address which is provided for connection. Append P2P Device Address to AP-STA-CONNECTED event for P2P Client connection. This will help applications to easily map the P2P Interface Address to P2P Device Address on CONNECTED event. For non-P2P case, it will just print the usual STA MAC address alone. Signed-off-by: Jithu Jance <jithu@broadcom.com>
This commit is contained in:
parent
5cbd88d921
commit
c9aab27406
3 changed files with 40 additions and 3 deletions
|
@ -27,6 +27,7 @@
|
|||
#include "eap_common/eap_wsc_common.h"
|
||||
#include "eapol_auth/eapol_auth_sm.h"
|
||||
#include "eapol_auth/eapol_auth_sm_i.h"
|
||||
#include "p2p/p2p.h"
|
||||
#include "hostapd.h"
|
||||
#include "accounting.h"
|
||||
#include "sta_info.h"
|
||||
|
@ -89,9 +90,23 @@ void ieee802_1x_set_sta_authorized(struct hostapd_data *hapd,
|
|||
return;
|
||||
|
||||
if (authorized) {
|
||||
if (!ap_sta_is_authorized(sta))
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO,
|
||||
AP_STA_CONNECTED MACSTR, MAC2STR(sta->addr));
|
||||
if (!ap_sta_is_authorized(sta)) {
|
||||
const u8 *dev_addr = NULL;
|
||||
#ifdef CONFIG_P2P
|
||||
dev_addr = p2p_group_get_dev_addr(hapd->p2p_group,
|
||||
sta->addr);
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
if (dev_addr)
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO,
|
||||
AP_STA_CONNECTED MACSTR
|
||||
" dev_addr=" MACSTR,
|
||||
MAC2STR(sta->addr), MAC2STR(dev_addr));
|
||||
else
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO,
|
||||
AP_STA_CONNECTED MACSTR,
|
||||
MAC2STR(sta->addr));
|
||||
}
|
||||
ap_sta_set_authorized(hapd, sta, 1);
|
||||
res = hostapd_set_authorized(hapd, sta, 1);
|
||||
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue