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

相关推荐
William_cl8 小时前
ASP.NET Core 视图组件:从入门到避坑,UI 复用的终极方案
后端·ui·asp.net
William_cl10 小时前
ASP.NET Core ViewData:弱类型数据交互的精髓与避坑指南
后端·asp.net·交互
MindCareers1 天前
Beta Sprint Day 1-2: Alpha Issue Fixes Initiated + Mobile Project Setup
android·c语言·数据库·c++·qt·sprint·issue
Net蚂蚁代码1 天前
【如何在ASP.Net Core中使用 IHostedService的方法】执行自动服务运行
后端·asp.net
code_li1 天前
P2P加速 vs. CDN加速
网络·网络协议·p2p
Caco.D2 天前
Aneiang.Pa.News:属于你自己的全平台热点聚合阅读器
爬虫·asp.net·aneiang.pa·热榜新闻
不过如此19512 天前
Python操作Jira实现不同项目之间的Issue同步
python·jira·issue
chao1898442 天前
基于 C# 实现 P2P 视频聊天工具
c#·音视频·p2p
咖丨喱2 天前
【解析并缓存 P2P_ATTR_DEVICE_INFO】
缓存·asp.net·p2p
咖丨喱3 天前
【解决Miracast出现组形成失败问题】
后端·asp.net