aboutsummaryrefslogtreecommitdiffstats
path: root/src/p2p
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2015-06-29 11:02:15 -0700
committerDmitry Shmidt <dimitrysh@google.com>2015-06-29 11:02:15 -0700
commit4171258d30a612645aa061cede62233b5c58ca2a (patch)
treec12afc44bece384cf603ba0579ef9191ea63925e /src/p2p
parenta3dc30964aa24aea2b518246f6812663a1103490 (diff)
downloadandroid_external_wpa_supplicant_8-4171258d30a612645aa061cede62233b5c58ca2a.tar.gz
android_external_wpa_supplicant_8-4171258d30a612645aa061cede62233b5c58ca2a.tar.bz2
android_external_wpa_supplicant_8-4171258d30a612645aa061cede62233b5c58ca2a.zip
Cumulative patch from commit 8c43ef8449bd4d2d0983db394770bd73f572b12d
8c43ef8 P2PS: Fix attribute addition in p2p_buf_add_service_instance() a9ea609 P2PS: Fix p2p_find last parameter handling 6c73149 AP: Increase maximum value accepted for cwmin/cwmax 575e4f5 SAE: Reject FFC commit-element with value p-1 a406244 P2PS: Do not reply to ProbeReq on another channel when starting Listen 0c2b3f6 SAE: Reject commit-scalar value 1 4f39908 Send CTRL-EVENT-NETWORK-NOT-FOUND if no suitable network was found 123df27 D-Bus: Fix typos in debug print ded14ce Android: Fix nl80211 build if BOARD_*_PRIVATE_LIB is unspecified a140721 Android: Rename ANDROID_P2P_STUB to ANDROID_LIB_STUB 2ba4de3 D-Bus: Add documentation for wpas_dbus_signal_peer_groups_changed() e48b5e2 D-Bus: Fix typo in dbus signal function documentation 09d5048 D-Bus: Add function documentation for wpas_dbus_unregister_interface() adfbbd2 D-Bus: Add function documentation for wpas_dbus_register_interface() c5967f0 D-Bus: Fix wpas_dbus_signal_p2p_invitation_result() documentation 4457f41 radius: Fix NULL dereference issue on allocation failure f826fb1 OpenSSL: Handle EC_POINT_is_on_curve() error case bbb5008 SAE: Use random "password" in extra hunting-and-pecking loops eb5fee0 SAE: Add side-channel protection to PWE derivation with ECC 16841ab crypto: Add functions for computing the Legendre symbol and EC y^2 c4a13b4 OpenSSL: Add support for Brainpool Elliptic Curves 4584b66 SAE: Increase security parameter k to 40 based on Dragonfly recommendation fdd731b SAE: Fix PWE generation to use minimum loop count (k) properly 8ec3332 SAE: Merge sae_derive_commit() error case return statements d93abd4 SAE: Merge sae_get_rand() error case return statements 6a58444 SAE: Verify that own/peer commit-scalar and COMMIT-ELEMENT are different 4e7e688 Add crypto_ec_point_cmp() 8e2a3a4 dbus: Do not initialize variable twice c1a14ef Do not check unsigned size is less than zero fdc5608 OpenSSL: Remove SSL_CTX_{get,set}_app_data() compatibility wrapper ba54933 libtommath: Fix mp_init_multi() stdarg use on error path f6332b0 wpa_gui: Initialize WpaGuiApp::w in the constructor f6df3f3 Use os_* wrapper more consistently 91b7a5e Use unsigned/signed printf format more consistently 59bae74 HS 2.0R2: Fix memory leak on error path in hs20-osu-client c5ca73d P2P: Use offsetof() instead of local implementation c3c5b5f ERP server: Make erp_send_finish_reauth() easier for static analyzers 6ce1bea bsd: Remove redundant NULL check in bsd_init() c99df20 Remove redundant NULL check in ieee802_1x_encapsulate_radius() 2eb5967 AP: Add more 2.4 GHz channels for 20/40 MHz HT co-ex scan 5ed6519 hw_features: Merge similar return cases 4e37dd6 SAE: Simplify sae_prepare_commit() error path 04e6c4c Fix SAE group selection in an error case 3dce85c HS 2.0: Add WLAN RADIUS attributes in OSEN case efd5d26 Remove unnecessary wpa_ie_len check from wpa_parse_wpa_ie_wpa() ce8963f Remove WEP40/WEP104 cipher suite support for WPA/WPA2 ee140ef FT: Stop association attempt if Auth response processing fails (SME) 1887be4 Make check_20mhz_bss() static Signed-off-by: Dmitry Shmidt <dimitrysh@google.com> Bug: 22062116 Change-Id: Ie1d175f1faab24bf39ce81ead7a078e1e236badd
Diffstat (limited to 'src/p2p')
-rw-r--r--src/p2p/p2p.c17
-rw-r--r--src/p2p/p2p_build.c7
2 files changed, 18 insertions, 6 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 16ffac43..b87ff96b 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -2315,6 +2315,19 @@ p2p_reply_probe(struct p2p_data *p2p, const u8 *addr, const u8 *dst,
u8 i;
int p2ps_svc_found = 0;
+ p2p_dbg(p2p, "in_listen=%d drv_in_listen=%d when received P2PS Probe Request at %u MHz; own Listen channel %u, pending listen freq %u MHz",
+ p2p->in_listen, p2p->drv_in_listen, rx_freq,
+ p2p->cfg->channel, p2p->pending_listen_freq);
+
+ if (!p2p->in_listen && !p2p->drv_in_listen &&
+ p2p->pending_listen_freq && rx_freq &&
+ rx_freq != p2p->pending_listen_freq) {
+ p2p_dbg(p2p, "Do not reply to Probe Request frame that was received on %u MHz while waiting to start Listen state on %u MHz",
+ rx_freq, p2p->pending_listen_freq);
+ p2p_parse_free(&msg);
+ return P2P_PREQ_NOT_LISTEN;
+ }
+
for (i = 0; i < msg.service_hash_count; i++) {
if (p2p_service_find_asp(p2p, hash)) {
p2p_dbg(p2p, "Service Hash match found: "
@@ -2389,8 +2402,8 @@ p2p_reply_probe(struct p2p_data *p2p, const u8 *addr, const u8 *dst,
return P2P_PREQ_NOT_PROCESSED;
}
- resp = NULL;
- resp = wpabuf_put(buf, resp->u.probe_resp.variable - (u8 *) resp);
+ resp = wpabuf_put(buf, offsetof(struct ieee80211_mgmt,
+ u.probe_resp.variable));
resp->frame_control = host_to_le16((WLAN_FC_TYPE_MGMT << 2) |
(WLAN_FC_STYPE_PROBE_RESP << 4));
diff --git a/src/p2p/p2p_build.c b/src/p2p/p2p_build.c
index 6b6e7701..c733543c 100644
--- a/src/p2p/p2p_build.c
+++ b/src/p2p/p2p_build.c
@@ -557,7 +557,7 @@ void p2p_buf_add_service_instance(struct wpabuf *buf, struct p2p_data *p2p,
struct p2ps_advertisement *adv_list)
{
struct p2ps_advertisement *adv;
- int p2ps_wildcard, found = 0;
+ int p2ps_wildcard;
size_t total_len;
struct wpabuf *tmp_buf = NULL;
u8 *pos, *attr_len, *ie_len = NULL;
@@ -593,7 +593,6 @@ void p2p_buf_add_service_instance(struct wpabuf *buf, struct p2p_data *p2p,
/* org.wi-fi.wfds match found */
p2p_buf_add_service_info(tmp_buf, p2p, 0, 0, P2PS_WILD_HASH_STR,
&ie_len, &pos, &total_len, attr_len);
- found++;
}
/* add advertised service info of matching services */
@@ -613,12 +612,12 @@ void p2p_buf_add_service_instance(struct wpabuf *buf, struct p2p_data *p2p,
&total_len,
attr_len))
break;
- found++;
+
test += P2PS_HASH_LEN;
}
}
- if (found)
+ if (total_len)
wpabuf_put_buf(buf, tmp_buf);
wpabuf_free(tmp_buf);
}