[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <90445abd30536f2785e34c705e3a9ce6c817b17a.camel@sipsolutions.net>
Date: Wed, 21 Aug 2019 09:59:20 +0200
From: Johannes Berg <johannes@...solutions.net>
To: James Nylen <jnylen@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] `iwlist scan` fails with many networks available
On Tue, 2019-08-13 at 00:43 +0000, James Nylen wrote:
> > I suppose we could consider applying a workaround like this if it has a
> > condition checking that the buffer passed in is the maximum possible
> > buffer (65535 bytes, due to iw_point::length being u16)
>
> This is what the latest patch does (attached to my email from
> yesterday / https://lkml.org/lkml/2019/8/10/452 ).
Hmm, yes, you're right. I evidently missed the comparisons to 0xFFFF
there, sorry about that.
> If you'd like to apply it, I'm happy to make any needed revisions.
> Otherwise I'm going to have to keep patching my kernels for this
> issue, unfortunately I don't have the time to try to get wicd to
> migrate to a better solution.
Not sure which would be easier, but ok :-)
Can you please fix the patch to
1) use /* */ style comments (see
https://www.kernel.org/doc/html/latest/process/coding-style.html)
2) remove extra braces (also per coding style)
3) use U16_MAX instead of 0xFFFF
I'd also consider renaming "maybe_current_ev" to "next_ev" or something
shorter anyway, and would probably argue that rewriting this
> + if (IS_ERR(maybe_current_ev)) {
> + err = PTR_ERR(maybe_current_ev);
> + if (err == -E2BIG) {
> + // Last BSS failed to copy into buffer. As
> + // above, only report an error if `iwlist` will
> + // retry again with a larger buffer.
> + if (len >= 0xFFFF) {
> + err = 0;
> + }
> + }
> break;
> + } else {
> + current_ev = maybe_current_ev;
> }
to something like
next_ev = ...
if (IS_ERR(next_ev)) {
err = PTR_ERR(next_ev);
/* mask error and truncate in case buffer cannot be
* increased
*/
if (err == -E2BIG && len < U16_MAX)
err = 0;
break;
}
current_ev = next_ev;
could be more readable, but that's just editorial really.
Thanks,
johannes
Powered by blists - more mailing lists