From: Johannes Berg <johannes@sipsolutions.net>
To: Ronald Wahl <ronald.wahl@raritan.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: Occasional truncated scan results
Date: Tue, 28 Feb 2012 15:42:46 +0100 [thread overview]
Message-ID: <1330440166.3368.7.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <4F4CE4D6.6020108@raritan.com> (sfid-20120228_152950_864254_C21F9143)
Hi,
> After some playing with different wireless devices I discovered that
> this is not limited to specific drivers so I digged a bit in the scan
> code in net/wireless/scan.c and found the culprit: The scan result is
> put together with the iwe_stream_* functions that place data into a
> provided buffer if enough space is available in the buffer. Otherwise
> the functions do just nothing. Before a BSS is added there is a check if
> some minimum space is available but after the BSS has been added it is
> not clear how many data actually has been placed into the buffer. So
> especially (but not neccessarily only) the last BSS is prone to be
> incomplete. I my case all the IEs were missing and this was persistent
> over some time (the persitence behavior seems to differs between drivers
> - probably depends on how the scanning is implemented).
>
> Currently I implemented a heuristic that checks if some minimum space
> (currently 256 bytes) is still free _after_ adding a BSS and otherwise
> return -E2BIG so the user space can provide a larger buffer but this is
> a crappy hack.
>
> Can the code be changed in some way to more reliably detect if some data
> did not fit into the buffer and report this to user space?
Unfortunately not. The maximum buffer size userspace can provide is
limited to 64k. In busy environments, this size can be exceeded. As a
result, if we do this, you can't get *any* scan results in such
environments. I believe the current code is almost the best we can do
for wireless extensions, but it may be possible to implement never
truncating a single BSS entry.
That said, there's a very simple fix for this. Since you're talking
about net/wireless/scan.c, you're obviously using a driver with cfg80211
support. Ditch wireless extensions completely and use nl80211 instead,
you'll be much happier overall as it has no such limitations and more
features.
johannes
next prev parent reply other threads:[~2012-02-28 14:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-28 14:29 Occasional truncated scan results Ronald Wahl
2012-02-28 14:42 ` Johannes Berg [this message]
2012-02-28 15:15 ` Ronald Wahl
2012-02-28 15:24 ` Johannes Berg
2012-02-28 15:35 ` Ronald Wahl
2012-02-29 8:36 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330440166.3368.7.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=ronald.wahl@raritan.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).