diff options
author | Jithu Jance <jithu@broadcom.com> | 2011-12-10 12:26:00 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2011-12-10 12:26:00 +0200 |
commit | 10cc6c883e1ecf4b6f4c6fc9430ff09ab227bafc (patch) | |
tree | adbc60b3fd714f1ff7704e8de48aa3555492d10b /src/ap | |
parent | 341eebee38127113e5ba69fc07db849231f89e8b (diff) | |
download | external_wpa_supplicant_8_ti-10cc6c883e1ecf4b6f4c6fc9430ff09ab227bafc.zip external_wpa_supplicant_8_ti-10cc6c883e1ecf4b6f4c6fc9430ff09ab227bafc.tar.gz external_wpa_supplicant_8_ti-10cc6c883e1ecf4b6f4c6fc9430ff09ab227bafc.tar.bz2 |
P2P: Append P2P Device Address to AP-STA-DISCONNECTED event
Append "p2p_dev_addr" parameter to AP-STA-DISCONNECTED event for P2P
connections. In addition, for AP-STA-CONNECTED event during P2P
connection, the "dev_addr=" print is replaced with "p2p_dev_addr=" to
be more consistent with other events.
Signed-hostap: Jithu Jance <jithu@broadcom.com>
Diffstat (limited to 'src/ap')
-rw-r--r-- | src/ap/sta_info.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index a9981cc..365e9e8 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -771,17 +771,18 @@ void ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta) void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta, int authorized) { + const u8 *dev_addr = NULL; if (!!authorized == !!(sta->flags & WLAN_STA_AUTHORIZED)) return; - if (authorized) { - const u8 *dev_addr = NULL; #ifdef CONFIG_P2P - 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 */ + + if (authorized) { if (dev_addr) wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED - MACSTR " dev_addr=" MACSTR, + MACSTR " p2p_dev_addr=" MACSTR, MAC2STR(sta->addr), MAC2STR(dev_addr)); else wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED @@ -789,7 +790,8 @@ void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta, if (hapd->msg_ctx_parent && hapd->msg_ctx_parent != hapd->msg_ctx && dev_addr) wpa_msg(hapd->msg_ctx_parent, MSG_INFO, - AP_STA_CONNECTED MACSTR " dev_addr=" MACSTR, + AP_STA_CONNECTED MACSTR " p2p_dev_addr=" + MACSTR, MAC2STR(sta->addr), MAC2STR(dev_addr)); else if (hapd->msg_ctx_parent && hapd->msg_ctx_parent != hapd->msg_ctx) @@ -798,10 +800,20 @@ void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta, sta->flags |= WLAN_STA_AUTHORIZED; } else { - wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED MACSTR, - MAC2STR(sta->addr)); + if (dev_addr) + 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 && - hapd->msg_ctx_parent != hapd->msg_ctx) + hapd->msg_ctx_parent != hapd->msg_ctx && dev_addr) + wpa_msg(hapd->msg_ctx_parent, MSG_INFO, + AP_STA_DISCONNECTED MACSTR " p2p_dev_addr=" + 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)); |