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>
This commit is contained in:
parent
d8d6b32eec
commit
1d277f0260
3 changed files with 36 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue