diff options
author | Ardong Chen <ardongchen@atheros.com> | 2010-09-06 18:10:55 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2010-09-10 10:30:25 -0700 |
commit | ffe98dfb88a19b66418184955ef272789e3abb68 (patch) | |
tree | f10b9a4dc176bf1013f517ef144bd9d23daa4db2 /src | |
parent | c0a321c519e944293fd4e97dc0bb4b17204c679e (diff) | |
download | external_wpa_supplicant_8_ti-ffe98dfb88a19b66418184955ef272789e3abb68.zip external_wpa_supplicant_8_ti-ffe98dfb88a19b66418184955ef272789e3abb68.tar.gz external_wpa_supplicant_8_ti-ffe98dfb88a19b66418184955ef272789e3abb68.tar.bz2 |
P2P: Process Invitation Request from previously unknown peer
Since this message now includes P2P Device Info attribute, it is
reasonable to learn the peer data and process the message instead of
rejecting the message.
Diffstat (limited to 'src')
-rw-r--r-- | src/p2p/p2p_invitation.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c index c309fe1..052690b 100644 --- a/src/p2p/p2p_invitation.c +++ b/src/p2p/p2p_invitation.c @@ -122,12 +122,27 @@ void p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa, return; dev = p2p_get_device(p2p, sa); - if (dev == NULL) { + if (dev == NULL || (dev->flags & P2P_DEV_PROBE_REQ_ONLY)) { wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, - "P2P: Reject Invitation Request from unknown peer " + "P2P: Invitation Request from unknown peer " MACSTR, MAC2STR(sa)); - status = P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE; - goto fail; + + if (p2p_add_device(p2p, sa, rx_freq, 0, data + 1, len - 1)) { + wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, + "P2P: Invitation Request add device failed " + MACSTR, MAC2STR(sa)); + status = P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE; + goto fail; + } + + dev = p2p_get_device(p2p, sa); + if (dev == NULL) { + wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, + "P2P: Reject Invitation Request from unknown " + "peer " MACSTR, MAC2STR(sa)); + status = P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE; + goto fail; + } } if (!msg.group_id || !msg.channel_list) { |