高通平台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接口

相关推荐
SEO-狼术20 小时前
ASP.NET Zero v15.0.0 adds full .NET
后端·asp.net·.net
赵庆明老师21 小时前
在ASP.NET Core Web Api中添加身份验证和授权
java·前端·asp.net
嘻哈baby1 天前
WebRTC实时通信原理与P2P连接实战
网络协议·webrtc·p2p
管家婆客服中心2 天前
Server 2008 R2系统安装IIS和ASP.NET框架
后端·asp.net
嘻哈baby2 天前
分布式组网架构设计:从BitTorrent DHT到现代SD-WAN的演进
分布式·后端·asp.net
武藤一雄2 天前
.NET中到底什么是SignalR (持续更新)
后端·微软·c#·asp.net·.net·.netcore·signalr
by__csdn2 天前
第二章 (.NET Core环境搭建)第二节( Visual Studio Code)
ide·vscode·c#·vue·asp.net·.net·.netcore
by__csdn2 天前
第二章 (.NET Core环境搭建)第三节( Visual Studio for Mac)
ide·kubernetes·c#·asp.net·.net·.netcore·visual studio
William_cl3 天前
【ASP.NET Core 进阶】Controller 过滤器之 ExceptionFilter:全局异常捕获的 “终极方案”(附避坑指南)
后端·asp.net
William_cl3 天前
【ASP.NET Core 进阶】Controller 过滤器之 ResultFilter:View 渲染前后的 “神操作”(附避坑指南)
后端·asp.net