Re: [PATCH RFC] wext: Add event stream wrappers that return E2BIG when values don't fit
From: James Minor <hidden>
Date: 2015-02-19 21:34:38
Also in:
linux-wireless, lkml
From: James Minor <hidden>
Date: 2015-02-19 21:34:38
Also in:
linux-wireless, lkml
On 01/29/2015 03:22 PM, Johannes Berg wrote:
quoted
What you mean is "with the wext (compatibility) code in cfg80211".
Comment fixed in the v2 of the patch (coming shortly).
quoted
Either way, I *strongly* recommend against using this in the first place. There's an upper bound of 64k (I think) on the amount of memory that can be used, and people have been known to run into this limit - at which point you get absolutely no scan results back whatsoever. It's far safer to use nl80211's scan dump, and if you're looking at this code in particular then clearly you have it available.
Agreed, and we will be switching to nl80211 as soon as we can.
quoted
Regarding the patch itself, it seems to add a bit much code. Is there really no better way to express this? Perhaps by checking that the stream actually moved forward - which will *always* happen for any of these functions if they actually did anything? Even maybe if the new _check inlines were to do that it'd still make the code smaller.
I've shuffled some things around and will submit the v2 momentarily. Thanks, James