linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Occasional truncated scan results
@ 2012-02-28 14:29 Ronald Wahl
  2012-02-28 14:42 ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Ronald Wahl @ 2012-02-28 14:29 UTC (permalink / raw)
  To: linux-wireless

Hi,

some time ago I had an issue with a wireless device that it couldn't 
associate to the AP over some time. I found out that the BSS with the 
corresponding SSID was the last in the scan list and was truncated - all 
the IEs were missing and so the supplicant did not detect that it 
supports WPA2 and hence ignored it.

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?

- ron

-- 
Ronald Wahl - ronald.wahl@raritan.com - Phone +49 375271349-0 Fax -99
Raritan Deutschland GmbH, Kornmarkt 7, 08056 Zwickau, Germany
USt-IdNr. DE813094160, Steuer-Nr. 227/117/01749
Amtsgericht Chemnitz HRB 23605
Geschäftsführung: Stuart Hopper, Burkhard Wessler

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-02-29  8:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-28 14:29 Occasional truncated scan results Ronald Wahl
2012-02-28 14:42 ` Johannes Berg
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

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).