diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2011-07-21 15:19:46 -0700 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2011-11-25 23:56:13 +0200 |
commit | 8a5e75f60f7a8ae1562e0ab82c6b2a2eb57350f3 (patch) | |
tree | e3be8e6a66fc7391761f76c8b2f031687a59c49b /src/ap | |
parent | fcd168478749251350d3d117eefa57dc3d5553ae (diff) | |
download | external_wpa_supplicant_8_ti-8a5e75f60f7a8ae1562e0ab82c6b2a2eb57350f3.zip external_wpa_supplicant_8_ti-8a5e75f60f7a8ae1562e0ab82c6b2a2eb57350f3.tar.gz external_wpa_supplicant_8_ti-8a5e75f60f7a8ae1562e0ab82c6b2a2eb57350f3.tar.bz2 |
P2P: Send STA connected/disconnected events to parent ctrl_iface
Send the connection events from P2P group to both the group interface
and parent interface ctrl_ifaces to make it easier for external monitor
programs to see these events without having to listen to all group
interfaces when virtual group interfaces are used.
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'src/ap')
-rw-r--r-- | src/ap/hostapd.h | 1 | ||||
-rw-r--r-- | src/ap/sta_info.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 5401e80..c9bec4f 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -82,6 +82,7 @@ struct hostapd_data { struct sta_info *sta, int reassoc); void *msg_ctx; /* ctx for wpa_msg() calls */ + void *msg_ctx_parent; /* parent interface ctx for wpa_msg() calls */ struct radius_client_data *radius; u32 acct_session_id_hi, acct_session_id_lo; diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index dc689ba..a9981cc 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -786,11 +786,25 @@ void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta, else wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED MACSTR, MAC2STR(sta->addr)); + 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, + 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; } 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) + wpa_msg(hapd->msg_ctx_parent, MSG_INFO, + AP_STA_DISCONNECTED MACSTR, + MAC2STR(sta->addr)); sta->flags &= ~WLAN_STA_AUTHORIZED; } |