Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2df190b authored by Ashish Kumar Dhanotiya's avatar Ashish Kumar Dhanotiya
Browse files

wlan: Validate correct bss add before Add tx pattern cmd

Host validates the bss address to check if the station
is still in comnnected state before sending the add tx
pattern command to FW.
Currently it is assumed that the vendor command
QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS contains the
bss address as the destination address in the parameters,
which is not correct assumption and if the DHCP address is
provided as part of the destination address in that case host
rejects this command as the validation of the bss address fails.

To address this issue, validate the correct bss address instead
of the destination address provided in the command.

Change-Id: I4bfe61461df4f174e9f194be0f30f8f32fa084a4
CRs-Fixed: 2672805
parent 4b039f81
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -7226,7 +7226,13 @@ wlan_hdd_add_tx_ptrn(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx,
    uint8_t pattern_id = 0;
    v_MACADDR_t dst_addr;
    uint16_t eth_type = htons(ETH_P_IP);
    hdd_station_ctx_t *hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
    if (!hdd_sta_ctx)
    {
        hddLog(LOGE, FL("Invalid station context"));
        return -EINVAL;
    }
    if (!hdd_connIsConnected(WLAN_HDD_GET_STATION_CTX_PTR(adapter)))
    {
        hddLog(LOGE, FL("Not in Connected state!"));
@@ -7286,6 +7292,9 @@ wlan_hdd_add_tx_ptrn(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx,
        goto fail;
    }
    vos_mem_copy(add_req->bss_address, hdd_sta_ctx->conn_info.bssId,
                 VOS_MAC_ADDR_SIZE);
    if (!tb[PARAM_DST_MAC_ADDR])
    {
        hddLog(LOGE, FL("attr dst mac address failed"));
+3 −0
Original line number Diff line number Diff line
@@ -4858,6 +4858,9 @@ typedef struct sSirAddPeriodicTxPtrn
    /* MAC Address for the adapter */
    tSirMacAddr macAddress;

     /* BSSID of the connection */
     tSirMacAddr bss_address;

    tANI_U8  ucPtrnId;           // Pattern ID
    tANI_U16 ucPtrnSize;         // Pattern size
    tANI_U32 usPtrnIntervalMs;   // In msec
+3 −0
Original line number Diff line number Diff line
@@ -6013,6 +6013,9 @@ typedef struct
  /* MAC Address for the adapter  */
  wpt_macAddr macAddr;

  /* BSSID */
  wpt_macAddr bss_address;

  wpt_uint8  ucPtrnId;           // Pattern ID
  wpt_uint16 ucPtrnSize;         // Pattern size
  wpt_uint32 usPtrnIntervalMs;   // In msec
+5 −5
Original line number Diff line number Diff line
@@ -12807,7 +12807,7 @@ WDI_ProcessAddPeriodicTxPtrnInd
  wpt_uint8                      selfStaIdx          = 0;
  wpt_uint8                    ucCurrentBSSSesIdx;
  WDI_BSSSessionType*          pBSSSes             = NULL;
  wpt_macAddr                  dst_addr;
  wpt_macAddr                  bss_address;
  /*-------------------------------------------------------------------------
     Sanity check
@@ -12851,12 +12851,12 @@ WDI_ProcessAddPeriodicTxPtrnInd
    return WDI_STATUS_E_FAILURE;
  }
  vos_mem_copy(dst_addr,
               &pAddPeriodicTxPtrnParams->wdiAddPeriodicTxPtrnParams.ucPattern[0],
  vos_mem_copy(bss_address,
               &pAddPeriodicTxPtrnParams->wdiAddPeriodicTxPtrnParams.bss_address,
               VOS_MAC_ADDR_SIZE);
  ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
                                dst_addr,
                                bss_address,
                                &pBSSSes);
  if ( NULL == pBSSSes )
  {
@@ -12864,7 +12864,7 @@ WDI_ProcessAddPeriodicTxPtrnInd
              "%s: Association sequence for this BSS does not exist. macBSSID "
              MAC_ADDRESS_STR,
              __func__,
             MAC_ADDR_ARRAY(dst_addr));
             MAC_ADDR_ARRAY(bss_address));
    wpalMemoryFree(pSendBuffer);
    return WDI_STATUS_E_NOT_ALLOWED;
  }