diff options
author | Pragaspathi Thilagaraj <tpragasp@codeaurora.org> | 2021-01-15 20:44:34 +0530 |
---|---|---|
committer | Hsiu Chang Chen <hsiuchangchen@google.com> | 2021-02-22 11:58:51 +0000 |
commit | 07005e64d21781258a435110c20d24980d8dbb7c (patch) | |
tree | 3fef4bdf74235506e299b4595f1c85e389f22d2a | |
parent | 2a3bf6c56421da6e8b9f9a8e70c85102e8ac59b1 (diff) | |
download | qcacld-07005e64d21781258a435110c20d24980d8dbb7c.tar.gz |
qcacld-3.0: Strip the fixed fields of assoc req/rsp in connect result
Driver sends the assoc request and association response frame to
the kernel/userspace on connection success & association failure
cases. In successful connection case, the driver strips the fixed
fields and sends only the Association request/response IEs. But
in association failure case driver includes the Fixed fields in
the connect result.
Don't include the fixed fields in the association request/
response frame sent in the connect result.
Bug: 177023529
Change-Id: I2e17df1669a8790253b1dde91f5ed100c1d3e6d9
CRs-Fixed: 2856213
Signed-off-by: Victor Hsu <hsuvictor@google.com>
-rw-r--r-- | core/hdd/src/wlan_hdd_assoc.c | 74 |
1 files changed, 48 insertions, 26 deletions
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 4e61f4ccfb..4ac687a95f 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -146,8 +146,8 @@ static const u8 ccp_rsn_oui_13[HDD_RSN_OUI_SIZE] = {0x50, 0x6F, 0x9A, 0x01}; /* Offset where the EID-Len-IE, start. */ -#define FT_ASSOC_RSP_IES_OFFSET 6 /* Capability(2) + AID(2) + Status Code(2) */ -#define FT_ASSOC_REQ_IES_OFFSET 4 /* Capability(2) + LI(2) */ +#define ASSOC_RSP_IES_OFFSET 6 /* Capability(2) + AID(2) + Status Code(2) */ +#define ASSOC_REQ_IES_OFFSET 4 /* Capability(2) + LI(2) */ #define HDD_PEER_AUTHORIZE_WAIT 10 @@ -1077,7 +1077,7 @@ hdd_send_ft_assoc_response(struct net_device *dev, unsigned int len = 0; u8 *assoc_rsp = NULL; - if (roam_info->nAssocRspLength < FT_ASSOC_RSP_IES_OFFSET) { + if (roam_info->nAssocRspLength < ASSOC_RSP_IES_OFFSET) { hdd_debug("Invalid assoc rsp length %d", roam_info->nAssocRspLength); return; @@ -1091,10 +1091,10 @@ hdd_send_ft_assoc_response(struct net_device *dev, return; } /* assoc_rsp needs to point to the IEs */ - assoc_rsp += FT_ASSOC_RSP_IES_OFFSET; + assoc_rsp += ASSOC_RSP_IES_OFFSET; /* Send the Assoc Resp, the supplicant needs this for initial Auth. */ - len = roam_info->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET; + len = roam_info->nAssocRspLength - ASSOC_RSP_IES_OFFSET; if (len > IW_GENERIC_IE_MAX) { hdd_err("Invalid Assoc resp length %d", len); return; @@ -2304,7 +2304,7 @@ static void hdd_send_re_assoc_event(struct net_device *dev, goto done; } - if (roam_info->nAssocRspLength < FT_ASSOC_RSP_IES_OFFSET) { + if (roam_info->nAssocRspLength < ASSOC_RSP_IES_OFFSET) { hdd_err("Invalid assoc rsp length %d", roam_info->nAssocRspLength); goto done; @@ -2317,7 +2317,7 @@ static void hdd_send_re_assoc_event(struct net_device *dev, goto done; /* assoc_rsp needs to point to the IEs */ - assoc_rsp += FT_ASSOC_RSP_IES_OFFSET; + assoc_rsp += ASSOC_RSP_IES_OFFSET; /* * Active session count is decremented upon disconnection, but during @@ -2335,7 +2335,7 @@ static void hdd_send_re_assoc_event(struct net_device *dev, } /* Send the Assoc Resp, the supplicant needs this for initial Auth */ - len = roam_info->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET; + len = roam_info->nAssocRspLength - ASSOC_RSP_IES_OFFSET; if (len > IW_GENERIC_IE_MAX) { hdd_err("Invalid Assoc resp length %d", len); goto done; @@ -3006,10 +3006,10 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, /* * assoc_rsp needs to point to the IEs */ - assoc_rsp += FT_ASSOC_RSP_IES_OFFSET; + assoc_rsp += ASSOC_RSP_IES_OFFSET; assoc_rsp_len = roam_info->nAssocRspLength - - FT_ASSOC_RSP_IES_OFFSET; + ASSOC_RSP_IES_OFFSET; hdd_debug("assoc_rsp_len %d", assoc_rsp_len); } else { @@ -3026,11 +3026,10 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, * assoc_req needs to point to * the IEs */ - assoc_req += - FT_ASSOC_REQ_IES_OFFSET; + assoc_req += ASSOC_REQ_IES_OFFSET; assoc_req_len = roam_info->nAssocReqLength - - FT_ASSOC_REQ_IES_OFFSET; + ASSOC_REQ_IES_OFFSET; } else { /* * This should contain only the @@ -3381,21 +3380,47 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, && !hddDisconInProgress) { u8 *assoc_rsp = NULL; u8 *assoc_req = NULL; + unsigned int assoc_rsp_len = 0; + unsigned int assoc_req_len = 0; if (roam_info) { if (roam_info->pbFrames) { - /* Association Request */ + /* Association Request */ assoc_req = (u8 *)(roam_info->pbFrames + - roam_info->nBeaconLength); + roam_info->nBeaconLength); + if (assoc_req) { + /* + * assoc_req needs to point to + * the IEs + */ + assoc_req += + ASSOC_REQ_IES_OFFSET; + assoc_req_len = + roam_info->nAssocReqLength - + ASSOC_REQ_IES_OFFSET; + } else { + assoc_req_len = 0; + } + /* Association Response */ assoc_rsp = (u8 *)(roam_info->pbFrames + roam_info->nBeaconLength + roam_info->nAssocReqLength); - hdd_debug("assoc_req_len %d assoc resp len %d", - roam_info->nAssocReqLength, - roam_info->nAssocRspLength); + if (assoc_rsp) { + /* + * assoc_rsp needs to point to the IEs + */ + assoc_rsp += ASSOC_RSP_IES_OFFSET; + assoc_rsp_len = + roam_info->nAssocRspLength - + ASSOC_RSP_IES_OFFSET; + } else { + assoc_rsp_len = 0; + } + hdd_debug("Assoc req len:%d rsp len:%d", + assoc_req_len, assoc_rsp_len); } hdd_err("send connect failure to nl80211: for bssid " QDF_MAC_ADDR_STR @@ -3422,12 +3447,10 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, hdd_connect_result(dev, roam_info->bssid.bytes, roam_info, assoc_req, - roam_info->nAssocReqLength, - assoc_rsp, - roam_info->nAssocRspLength, + assoc_req_len, + assoc_rsp, assoc_rsp_len, WLAN_STATUS_ASSOC_DENIED_UNSPEC, - GFP_KERNEL, - connect_timeout, + GFP_KERNEL, connect_timeout, roam_info->status_code); else hdd_connect_result(dev, @@ -3442,9 +3465,8 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, hdd_connect_result(dev, roam_info->bssid.bytes, roam_info, assoc_req, - roam_info->nAssocReqLength, - assoc_rsp, - roam_info->nAssocRspLength, + assoc_req_len, + assoc_rsp, assoc_rsp_len, roam_info->reasonCode ? roam_info->reasonCode : WLAN_STATUS_UNSPECIFIED_FAILURE, |