aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Ravi <sunilravi@google.com>2023-11-16 21:25:17 +0000
committerSunil Ravi <sunilravi@google.com>2023-11-16 22:18:29 +0000
commit80b069714ebf9bae331a1deccc7b197f877c3bfa (patch)
treef64b2c34ce7d237cca8597dff18c734fa08a6e1b
parent76da14cd1b7bdf6ad88678b769b5b0824308591c (diff)
downloadwpa_supplicant_8-80b069714ebf9bae331a1deccc7b197f877c3bfa.tar.gz
Fix null pointer exception due to no device mac address
When legacy clients connect to P2P GO, there won't be a P2P device address in AP-STA-CONNECTED/AP-STA-DISCONNECTED event. So fill the p2p device address in AP-STA-CONNECTED and AP-STA-DISCONNECTED events to framework as {0, 0, 0, 0, 0, 0}; Bug: 310969135 Bug: 291202830 Test: Setup P2P auto GO Connect from a legacy STA to GO Change-Id: I10e5fb023294d65318ab74de6546eb736dd72258
-rw-r--r--wpa_supplicant/aidl/aidl_manager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/wpa_supplicant/aidl/aidl_manager.cpp b/wpa_supplicant/aidl/aidl_manager.cpp
index add0ef77..e760a715 100644
--- a/wpa_supplicant/aidl/aidl_manager.cpp
+++ b/wpa_supplicant/aidl/aidl_manager.cpp
@@ -1620,8 +1620,10 @@ void AidlManager::notifyApStaAuthorized(
P2pPeerClientJoinedEventParams params;
params.groupInterfaceName = misc_utils::charBufToString(wpa_group_s->ifname);
params.clientInterfaceAddress = macAddrToArray(sta);
- params.clientDeviceAddress = macAddrToArray(p2p_dev_addr);
+ params.clientDeviceAddress = p2p_dev_addr ?
+ macAddrToArray(p2p_dev_addr) : macAddrToArray(kZeroBssid.data());
params.clientIpAddress = aidl_ip;
+
callWithEachP2pIfaceCallback(
misc_utils::charBufToString(wpa_s->ifname),
std::bind(
@@ -1641,7 +1643,9 @@ void AidlManager::notifyApStaDeauthorized(
P2pPeerClientDisconnectedEventParams params;
params.groupInterfaceName = misc_utils::charBufToString(wpa_group_s->ifname);
params.clientInterfaceAddress = macAddrToArray(sta);
- params.clientDeviceAddress = macAddrToArray(p2p_dev_addr);
+ params.clientDeviceAddress = p2p_dev_addr ?
+ macAddrToArray(p2p_dev_addr) : macAddrToArray(kZeroBssid.data());
+
callWithEachP2pIfaceCallback(
misc_utils::charBufToString(wpa_s->ifname),
std::bind(