iwinfo: generic improvement of assoclist handling #19
+61
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This small PR makes generic improvement of assoclist handling.
Idea is to prevent any API change. User still needs to update their function to account for NULL buffer and len but updates likes that will only improve a fragile code.
This improves the assoc list and maybe also reduce the memory footprint. Allocating a big enough BUFFER is problematic for assoclist as it can grow a lot as it will contain info for every associated station.
To handle this, implement common practice way to get the number of element to alloc and dynamically alloc the space.
To apply this logic assoc list function needs to be called twice but this should not cause additional overhead.