aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2012-07-21 01:04:50 +0300
committerArik Nemtsov <arik@wizery.com>2012-08-02 13:04:02 +0300
commit9e56cb4dbf692d0f42c285cd666d8a07acdfe014 (patch)
treef42b61bd44bba932763cf7406c6f1cc98a33dda0
parentb391fd8179087f815461617717c06e4164608157 (diff)
downloadexternal_wpa_supplicant_8_ti-9e56cb4dbf692d0f42c285cd666d8a07acdfe014.zip
external_wpa_supplicant_8_ti-9e56cb4dbf692d0f42c285cd666d8a07acdfe014.tar.gz
external_wpa_supplicant_8_ti-9e56cb4dbf692d0f42c285cd666d8a07acdfe014.tar.bz2
P2P: Avoid peer expiration while connection in progress (BRCM)
(This seems to be a bug fix squashed in one of the BRCM patches. Could be that the probability of this occuring once the expiration time was reduced to 30s is higher) Signed-off-by: Eyal Shapira <eyal@wizery.com>
-rw-r--r--src/p2p/p2p.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 7f34be4..9a74450 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -50,6 +50,32 @@ static void p2p_scan_timeout(void *eloop_ctx, void *timeout_ctx);
#define P2P_PEER_EXPIRATION_INTERVAL (P2P_PEER_EXPIRATION_AGE / 2)
+#ifdef ANDROID_P2P
+int p2p_connection_in_progress(struct p2p_data *p2p)
+{
+ int ret = 0;
+
+ switch (p2p->state) {
+ case P2P_CONNECT:
+ case P2P_CONNECT_LISTEN:
+ case P2P_GO_NEG:
+ case P2P_WAIT_PEER_CONNECT:
+ case P2P_WAIT_PEER_IDLE:
+ case P2P_PROVISIONING:
+ case P2P_INVITE:
+ case P2P_INVITE_LISTEN:
+ ret = 1;
+ break;
+
+ default:
+ wpa_printf(MSG_DEBUG, "p2p_connection_in_progress state %d", p2p->state);
+ ret = 0;
+ }
+
+ return ret;
+}
+#endif
+
static void p2p_expire_peers(struct p2p_data *p2p)
{
struct p2p_device *dev, *n;
@@ -86,7 +112,14 @@ static void p2p_expire_peers(struct p2p_data *p2p)
continue;
}
- wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Expiring old peer "
+#ifdef ANDROID_P2P
+ /* If Connection is in progress, don't expire the peer
+ */
+ if (p2p_connection_in_progress(p2p))
+ continue;
+#endif
+
+ wpa_msg(p2p->cfg->msg_ctx, MSG_ERROR, "P2P: Expiring old peer "
"entry " MACSTR, MAC2STR(dev->info.p2p_device_addr));
#ifdef ANDROID_P2P
/* SD_FAIR_POLICY: Update the current sd_dev_list pointer to next device */