qcacld-3.0: lim_strip_ie to extract multiple IEs of given type
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
This commit is contained in:
parent
42622bc171
commit
a5935ee910
@ -5927,7 +5927,7 @@ QDF_STATUS lim_strip_ie(struct mac_context *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 (!addn_ie) {
|
||||
pe_debug("NULL addn_ie pointer");
|
||||
@ -5938,6 +5938,9 @@ QDF_STATUS lim_strip_ie(struct mac_context *mac_ctx,
|
||||
if (!tempbuf)
|
||||
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;
|
||||
@ -5968,11 +5971,13 @@ QDF_STATUS lim_strip_ie(struct mac_context *mac_ctx,
|
||||
* take oui IE and store in provided buffer.
|
||||
*/
|
||||
if (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;
|
||||
|
Loading…
Reference in New Issue
Block a user