]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Fix peer entry generation based on USD
authorJouni Malinen <quic_jouni@quicinc.com>
Tue, 29 Oct 2024 10:27:12 +0000 (12:27 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 31 Oct 2024 09:31:57 +0000 (11:31 +0200)
All cases calling dev_found() for a P2P peer will need to set the peer
flags to indicate it has been reported. In particular, this is needed to
avoid memory leaks in D-Bus code and in P2P peer cleanup. The recently
added P2P2 case using USD did not update the flags, so fix it to match
other cases.

Fixes: b4f9742ee246 ("P2P2: Process Element container attribute from NAN SDFs")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/p2p/p2p.c

index 9d5e63d3c602fede49dc5964ccaf9f815221fe04..e009a1502775a588d1d2cef812d610c4544a4c33 100644 (file)
@@ -6097,6 +6097,7 @@ void p2p_process_usd_elems(struct p2p_data *p2p, const u8 *ies, u16 ies_len,
 
        p2p->cfg->dev_found(p2p->cfg->cb_ctx, dev->info.p2p_device_addr,
                            &dev->info, !(dev->flags & P2P_DEV_REPORTED_ONCE));
+       dev->flags |= P2P_DEV_REPORTED | P2P_DEV_REPORTED_ONCE;
 
        p2p_parse_free(&msg);
 }