linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jouni Malinen <j@w1.fi>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Dan Williams <dcbw@redhat.com>, Samuel Ortiz <samuel@sortiz.org>,
	John Linville <linville@tuxdriver.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH RFC] mac80211: Filter scan results
Date: Thu, 5 Feb 2009 13:10:58 +0200	[thread overview]
Message-ID: <20090205111058.GA16422@jm.kir.nu> (raw)
In-Reply-To: <20090205084407.GA11126@jm.kir.nu>

On Thu, Feb 05, 2009 at 10:44:07AM +0200, Jouni Malinen wrote:
> As far as a possible workaround in kernel code is concerned,
> length=65535 could be considered a special case. Since it is clear that
> userspace cannot provide a larger buffer, there is not much point in
> returning -E2BIG. Instead, the results could be truncated after the last
> BSS that fit into the buffer and that would be returned to userspace.
> This is likely going to be much more useful than not being able to
> receive any result.

And here's an example patch on doing that for mac80211 (drivers that do
not use mac80211 would need to do something similar if they want to
support this mechanism). Would this change be acceptable for mac80211?

---
 net/mac80211/scan.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

--- wireless-testing.orig/net/mac80211/scan.c	2009-02-05 11:33:37.000000000 +0200
+++ wireless-testing/net/mac80211/scan.c	2009-02-05 13:07:41.000000000 +0200
@@ -934,6 +934,19 @@ int ieee80211_scan_results(struct ieee80
 	list_for_each_entry(bss, &local->bss_list, list) {
 		if (buf + len - current_ev <= IW_EV_ADDR_LEN) {
 			spin_unlock_bh(&local->bss_lock);
+			if (len == 65535) {
+				/*
+				 * WEXT uses 16-bit field for the length which
+				 * means that the largest buffer size that can
+				 * be used here is 65535 bytes. There is not
+				 * much help in returning -E2BIG if the user
+				 * space program cannot use a larger buffer. As
+				 * a workaround, return as many BSSes as
+				 * possible instead of making it impossible for
+				 * the application to get any results.
+				 */
+				return current_ev - buf;
+			}
 			return -E2BIG;
 		}
 		current_ev = ieee80211_scan_result(local, info, bss,
 
-- 
Jouni Malinen                                            PGP id EFC895FA

  parent reply	other threads:[~2009-02-05 11:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-04 15:08 [PATCH RFC] mac80211: Filter scan results Samuel Ortiz
2009-02-04 15:10 ` Johannes Berg
2009-02-04 23:18   ` Marcel Holtmann
2009-02-04 23:20     ` Dan Williams
2009-02-04 23:29       ` Marcel Holtmann
2009-02-04 23:31     ` Johannes Berg
2009-02-04 16:09 ` Dan Williams
2009-02-04 23:19   ` Marcel Holtmann
2009-02-04 23:22     ` Dan Williams
2009-02-04 23:23 ` Dan Williams
2009-02-04 23:35   ` Johannes Berg
2009-02-05  8:44     ` Jouni Malinen
2009-02-05  9:52       ` Jouni Malinen
2009-02-05 11:44         ` Tomas Winkler
2009-02-05 12:12           ` Jouni Malinen
2009-02-05 13:00             ` Tomas Winkler
2009-02-05 14:57               ` Dan Williams
2009-02-05 15:36                 ` Tomas Winkler
2009-02-05 11:10       ` Jouni Malinen [this message]
2009-02-05 11:55         ` Johannes Berg
2009-02-05 12:07           ` Jouni Malinen
2009-02-05 12:10             ` Johannes Berg
2009-02-05 12:26               ` Jouni Malinen
2009-02-05 22:42                 ` Johannes Berg

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=20090205111058.GA16422@jm.kir.nu \
    --to=j@w1.fi \
    --cc=dcbw@redhat.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=reinette.chatre@intel.com \
    --cc=samuel@sortiz.org \
    /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).