aboutsummaryrefslogtreecommitdiffstats
path: root/src/p2p/p2p.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-01-25 17:00:59 +0200
committerJouni Malinen <j@w1.fi>2012-01-25 17:00:59 +0200
commit1d277f02600d285b2cb6f636dd0fd6b8c960854d (patch)
tree6dfbb48af72f78ff449600cb11f65daf9883d0a1 /src/p2p/p2p.c
parentd8d6b32eec68457279c27854b5aea1166136667b (diff)
downloadexternal_wpa_supplicant_8_ti-1d277f02600d285b2cb6f636dd0fd6b8c960854d.zip
external_wpa_supplicant_8_ti-1d277f02600d285b2cb6f636dd0fd6b8c960854d.tar.gz
external_wpa_supplicant_8_ti-1d277f02600d285b2cb6f636dd0fd6b8c960854d.tar.bz2
P2P: Do not expire peer entry if peer is connected as a client
Even though we may not receive a Probe Response from the peer during the connection, we should not be expiring a P2P peer entry while that peer is connected to a group where we are the GO. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/p2p/p2p.c')
-rw-r--r--src/p2p/p2p.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 2fcac0e..4237657 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -56,11 +56,26 @@ static void p2p_expire_peers(struct p2p_data *p2p)
{
struct p2p_device *dev, *n;
struct os_time now;
+ size_t i;
os_get_time(&now);
dl_list_for_each_safe(dev, n, &p2p->devices, struct p2p_device, list) {
if (dev->last_seen.sec + P2P_PEER_EXPIRATION_AGE >= now.sec)
continue;
+ for (i = 0; i < p2p->num_groups; i++) {
+ if (p2p_group_is_client_connected(
+ p2p->groups[i], dev->info.p2p_device_addr))
+ break;
+ }
+ if (i < p2p->num_groups) {
+ /*
+ * The peer is connected as a client in a group where
+ * we are the GO, so do not expire the peer entry.
+ */
+ os_get_time(&dev->last_seen);
+ continue;
+ }
+
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Expiring old peer "
"entry " MACSTR, MAC2STR(dev->info.p2p_device_addr));
dl_list_del(&dev->list);