Thread (9 messages) 9 messages, 4 authors, 2006-08-04
STALE7260d
Revisions (6)
  1. v1 current
  2. v1 [diff vs current]
  3. v1 [diff vs current]
  4. v1 [diff vs current]
  5. v1 [diff vs current]
  6. v1 [diff vs current]

[PATCH 2/5] d80211: return correct error codes for scan requests

From: Jiri Benc <hidden>
Date: 2006-08-01 19:16:55
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Do not allow scanning when the network interface is down. Return 0 instead
of -EBUSY when scanning is in progress on the same network interface.

Signed-off-by: Jiri Benc <redacted>

---

 net/d80211/ieee80211_ioctl.c |    6 ++++++
 net/d80211/ieee80211_sta.c   |    5 ++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

2cf10f1a78222a375297d01a919d55d1a3c2a5a6
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index d73693e..e43e3b0 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -1091,6 +1091,9 @@ static int ieee80211_ioctl_scan_req(stru
 	if (local->user_space_mlme)
 		return -EOPNOTSUPP;
 
+	if (!netif_running(dev))
+		return -ENETDOWN;
+
 	if (left < len || len > IEEE80211_MAX_SSID_LEN)
 		return -EINVAL;
 
@@ -1914,6 +1917,9 @@ static int ieee80211_ioctl_siwscan(struc
 	u8 *ssid = NULL;
 	size_t ssid_len = 0;
 
+	if (!netif_running(dev))
+		return -ENETDOWN;
+
 	if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) {
 		if (sdata->type == IEEE80211_IF_TYPE_STA ||
 		    sdata->type == IEEE80211_IF_TYPE_IBSS) {
diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c
index 22f9599..13dcdae 100644
--- a/net/d80211/ieee80211_sta.c
+++ b/net/d80211/ieee80211_sta.c
@@ -2548,8 +2548,11 @@ int ieee80211_sta_req_scan(struct net_de
 	/* TODO: if assoc, move to power save mode for the duration of the
 	 * scan */
 
-	if (local->sta_scanning)
+	if (local->sta_scanning) {
+		if (local->scan_work.data == dev)
+			return 0;
 		return -EBUSY;
+	}
 
 	printk(KERN_DEBUG "%s: starting scan\n", dev->name);
 
-- 
1.3.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help