高通平台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 天前
【学习记录】宝塔面板 + Docker 快速部署 RustDesk 自建远程控制服务器
服务器·docker·开源·p2p·rustdesk
敲敲敲-敲代码4 天前
web系统(asp.net和C#)
前端·c#·asp.net
老葱头蒸鸡4 天前
(28)ASP.NET Core8.0 SOLID原则
后端·asp.net
王家视频教程图书馆4 天前
C# asp.net模板代码简单API请求
开发语言·c#·asp.net
weixin_443290696 天前
【云服务器相关】云服务器与P2P
运维·服务器·云计算·p2p
SEO-狼术6 天前
Telerik UI for ASP.NET MVC 2025 Q3
ui·asp.net·mvc
速易达网络6 天前
.NET MVC中实现后台商品列表功能
asp.net·mvc
老葱头蒸鸡8 天前
(23)ASP.NET Core2.2 EF关系数据库建模
后端·asp.net
老葱头蒸鸡9 天前
(14)ASP.NET Core2.2 中的日志记录
后端·asp.net
准时准点睡觉9 天前
HTTP 错误 403.14 - Forbidden Web 服务器被配置为不列出此目录的内容——错误代码:0x00000000
运维·服务器·iis·asp.net