高通平台wifi--p2p issue

需求:

p2p: check p2p instance in all asynchronized callbacks

If cancelConnect is not called, the scan retry callback would be called several times. If P2P is disabled in this period,these asynchronized callbacks would access de-initialized p2p instance and result in native crash.

code:

复制代码
  1. ------------------- wpa_supplicant/hidl/1.2/p2p_iface.cpp --------------------

  2. index 0a6b657d..fd9ce0dc 100644

  3. @@ -225,7 +225,7 @@ int joinScanReq(

  4. size_t ielen;

  5. unsigned int bands;

  6. - if (!wpa_s->global->p2p) {

  7. + if (wpa_s->global->p2p == NULL || wpa_s->global->p2p_disabled) {

  8. wpa_printf(MSG_ERROR,

  9. "P2P: P2P interface is gone, cancel join scan");

  10. return -ENXIO;

  11. @@ -1634,7 +1634,7 @@ SupplicantStatus P2pIface::addGroup_1_2Internal(

  12. int vht = wpa_s->conf->p2p_go_vht;

  13. int ht40 = wpa_s->conf->p2p_go_ht40 || vht;

  14. - if (wpa_s->global->p2p == NULL) {

  15. + if (wpa_s->global->p2p == NULL || wpa_s->global->p2p_disabled) {

  16. return {SupplicantStatusCode::FAILURE_IFACE_DISABLED, ""};

  17. }

  18. @@ -1691,6 +1691,9 @@ SupplicantStatus P2pIface::addGroup_1_2Internal(

  19. pending_join_scan_callback =

  20. [wpa_s, ssid, freq]() {

  21. + if (wpa_s->global->p2p == NULL || wpa_s->global->p2p_disabled) {

  22. + return;

  23. + }

  24. int ret = joinScanReq(wpa_s, ssid, freq);

  25. // for BUSY case, the scan might be occupied by WiFi.

  26. // Do not give up immediately, but try again later.

  27. @@ -1707,7 +1710,7 @@ SupplicantStatus P2pIface::addGroup_1_2Internal(

  28. };

  29. pending_scan_res_join_callback = [wpa_s, ssid, passphrase, peer_address, this]() {

  30. - if (wpa_s->global->p2p_disabled) {

  31. + if (wpa_s->global->p2p == NULL || wpa_s->global->p2p_disabled) {

  32. return;

  33. }

解释:

p2p_iface.cpp是守护wpa_supplicant的hidl接口

相关推荐
啊阿狸不会拉杆1 天前
《计算机网络-自顶向下方法》2.5 P2P 文件分发 读书笔记
计算机网络·wireshark·asp.net·p2p
FakeOccupational2 天前
【p2p、分布式,区块链笔记 IPFS】网关+多地址+HTTP RPC API+kubo-rpc-client
分布式·区块链·p2p
筝筝ba3 天前
extended/factory_reset.robot
linux·运维·服务器·网络·网络协议·p2p
Lost of 程序猿5 天前
ASP.NET Core Saga 分布式事务深度实战:备件采购跨服务长流程,如何保证“要么全成,要么全回“
分布式·后端·asp.net
SendTomo5 天前
send.wang:基于浏览器WebRTC实现无客户端文件互传
网络·python·网络协议·webrtc·p2p
Lost of 程序猿5 天前
ASP.NET Core API 幂等性设计深度实战:从一次重复申领事故说起
后端·asp.net
Lost of 程序猿6 天前
ASP.NET Core 多租户架构深度实战:一套系统,管理一支船队
后端·架构·asp.net
●VON6 天前
AtomGit 新手教程:Issue 和 PR 是什么?从 Fork、Clone 到提交 Pull Request 全流程
计算机·issue·pr
Lost of 程序猿6 天前
Hangfire 任务调度深度实战:从即时任务到卫星断点续传
asp.net
A_nanda8 天前
拆解ASP.NET Core 底层源码!从零手写
后端·asp.net