diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2012-01-25 17:27:47 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-01-25 17:27:47 +0200 |
commit | b1aebbc427c6a78e7c7526cc88b5576e410a1729 (patch) | |
tree | 44a98979bc85537b96e6b364c946656627ec9bfe /src | |
parent | 1d277f02600d285b2cb6f636dd0fd6b8c960854d (diff) | |
download | external_wpa_supplicant_8_ti-b1aebbc427c6a78e7c7526cc88b5576e410a1729.zip external_wpa_supplicant_8_ti-b1aebbc427c6a78e7c7526cc88b5576e410a1729.tar.gz external_wpa_supplicant_8_ti-b1aebbc427c6a78e7c7526cc88b5576e410a1729.tar.bz2 |
P2P: Do not expire peer entry if we are connected to the peer
Even though we may not update P2P peer entry while connected to the
peer as a P2P client, we should not be expiring a P2P peer entry while
that peer is the GO in a group where we are connected as a P2P client.
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/p2p/p2p.c | 12 | ||||
-rw-r--r-- | src/p2p/p2p.h | 9 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 4237657..2f4c114 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -62,6 +62,18 @@ static void p2p_expire_peers(struct p2p_data *p2p) 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; + + if (p2p->cfg->go_connected && + p2p->cfg->go_connected(p2p->cfg->cb_ctx, + dev->info.p2p_device_addr)) { + /* + * We are connected as a client to a group in which the + * peer is the GO, so do not expire the peer entry. + */ + os_get_time(&dev->last_seen); + continue; + } + for (i = 0; i < p2p->num_groups; i++) { if (p2p_group_is_client_connected( p2p->groups[i], dev->info.p2p_device_addr)) diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index d929c50..0924db5 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -706,6 +706,15 @@ struct p2p_config { * local failure in transmitting the Invitation Request. */ void (*invitation_result)(void *ctx, int status, const u8 *bssid); + + /** + * go_connected - Check whether we are connected to a GO + * @ctx: Callback context from cb_ctx + * @dev_addr: P2P Device Address of a GO + * Returns: 1 if we are connected as a P2P client to the specified GO + * or 0 if not. + */ + int (*go_connected)(void *ctx, const u8 *dev_addr); }; |