|
@@ -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);
|