wlan: Fix for address scheme for p2p device administarted.
Change-Id: I25792e0b54b94b9f8e29c8768a15aa5e9a68aa4b
CR-Fixed: 411651
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index c435139..9f6e6ba 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -3701,31 +3701,26 @@
if (pAdapter != NULL)
{
#ifdef WLAN_FEATURE_P2P
- if ( pHddCtx->cfg_ini->isP2pDeviceAddrAdministrated )
+ tANI_U8* p2p_dev_addr = wlan_hdd_get_intf_addr(pHddCtx);
+ if (p2p_dev_addr != NULL)
{
- vos_mem_copy( pHddCtx->p2pDeviceAddress.bytes,
- pHddCtx->cfg_ini->intfMacAddr[0].bytes,
- sizeof(tSirMacAddr));
- /* Generate the P2P Device Address. This consists of the device's
- * primary MAC address with the locally administered bit set.
- */
- pHddCtx->p2pDeviceAddress.bytes[0] |= 0x02;
+ vos_mem_copy(&pHddCtx->p2pDeviceAddress.bytes[0],
+ p2p_dev_addr, VOS_MAC_ADDR_SIZE);
+
+ if ( pHddCtx->cfg_ini->isP2pDeviceAddrAdministrated )
+ {
+ /* Generate the P2P Device Address. This consists of the device's
+ * primary MAC address with the locally administered bit set.
+ */
+ pHddCtx->p2pDeviceAddress.bytes[0] |= 0x02;
+ }
}
else
{
- tANI_U8* p2p_dev_addr = wlan_hdd_get_intf_addr(pHddCtx);
- if (p2p_dev_addr != NULL)
- {
- vos_mem_copy(&pHddCtx->p2pDeviceAddress.bytes[0],
- p2p_dev_addr, VOS_MAC_ADDR_SIZE);
- }
- else
- {
- hddLog(VOS_TRACE_LEVEL_FATAL,
- "%s: Failed to allocate mac_address for p2p_device",
- __FUNCTION__);
- goto err_close_adapter;
- }
+ hddLog(VOS_TRACE_LEVEL_FATAL,
+ "%s: Failed to allocate mac_address for p2p_device",
+ __FUNCTION__);
+ goto err_close_adapter;
}
pP2pAdapter = hdd_open_adapter( pHddCtx, WLAN_HDD_P2P_DEVICE, "p2p%d",