diff options
author | Aditya Kodukula <quic_akodukul@quicinc.com> | 2019-11-03 12:51:08 +0530 |
---|---|---|
committer | chenpaul <chenpaul@google.com> | 2021-02-03 14:59:05 +0800 |
commit | f0a8aa86d8e46c1c388f88439a3da3b49306c5af (patch) | |
tree | 2032fdfeffbadd1a0fe871ad01d8419619488aaf | |
parent | b197a91b7982d5cc98eaf81cccc12ed385f92c63 (diff) | |
download | qcacld-f0a8aa86d8e46c1c388f88439a3da3b49306c5af.tar.gz |
qcacld-3.0: lim_strip_ie to extract multiple IEs
Currently lim_strip_ie strips the matched IEs from given buffer
but return only last matched IE. All the previous IEs matched to
the given type are lost. Fix this to strip and extract all IEs
matched to given type.
This is to address the case when multiple vendor specific IEs are
given from userspace. Current implementation returns only
last vendor specific IE. This is to fix the same.
Change-Id: I64ca5d2e679b8457dc2cbaf7b4b12dc0a840260d
CRs-Fixed: 2499592
Bug: 170058356
Signed-off-by: Aditya Kodukula <quic_akodukul@quicinc.com>
-rw-r--r-- | core/mac/src/pe/lim/lim_utils.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 3eb383f7a9..5b295f8e3c 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -6692,7 +6692,7 @@ QDF_STATUS lim_strip_ie(tpAniSirGlobal mac_ctx, int left = *addn_ielen; uint8_t *ptr = addn_ie; uint8_t elem_id; - uint16_t elem_len; + uint16_t elem_len, ie_len, extracted_ie_len = 0; if (NULL == addn_ie) { pe_debug("NULL addn_ie pointer"); @@ -6705,6 +6705,9 @@ QDF_STATUS lim_strip_ie(tpAniSirGlobal mac_ctx, return QDF_STATUS_E_NOMEM; } + if (extracted_ie) + qdf_mem_zero(extracted_ie, eid_max_len + size_of_len_field + 1); + while (left >= 2) { elem_id = ptr[0]; left -= 1; @@ -6735,11 +6738,13 @@ QDF_STATUS lim_strip_ie(tpAniSirGlobal mac_ctx, * take oui IE and store in provided buffer. */ if (NULL != extracted_ie) { - qdf_mem_zero(extracted_ie, - eid_max_len + size_of_len_field + 1); - if (elem_len <= eid_max_len) - qdf_mem_copy(extracted_ie, &ptr[0], - elem_len + size_of_len_field + 1); + ie_len = elem_len + size_of_len_field + 1; + if (ie_len <= eid_max_len - extracted_ie_len) { + qdf_mem_copy( + extracted_ie + extracted_ie_len, + &ptr[0], ie_len); + extracted_ie_len += ie_len; + } } } left -= elem_len; |