Skip to contentSkip to conversation

orinoco: Drop scan results with unknown channels

PATCH In review Joe Gunn 2 participants 2 messages Feb 25, 2011 Networking drivers (wireless)

lore
Share & tools
lore

Joe Gunn

author
#0 lore raw

PATCH 1/1 orinoco: Drop scan results with unknown channels

If the frequency can not be mapped to a channel structure log it and drop it.
---
The driver was getting an error return from the frequency map. The invalid freq uency was not in the frequency table, so the channel structure returned null. T his test fro that case and does not allow the packet to continue up the stack.
---

drivers/net/wireless/orinoco renamed from drivers/net/wireless/orinoco/scan.c +0 -0

/scan.c
index 86cb54c..e99ca1c 100644

drivers/net/wireless/orinoco/scan.c +0 -0
@@ -111,6 +111,11 @@ static void orinoco_add_hostscan_result(struct orinoco_pri

vate *priv,

freq = ieee80211_dsss_chan_to_freq(le16_to_cpu(bss->a.channel)); channel = ieee80211_get_channel(wiphy, freq);
+ if (!channel) {
+ printk(KERN_DEBUG "Invalid channel designation %04X(%04X)",
+ bss->a.channel, freq);
+ return; /* Then ignore it for now */
+ }
timestamp = 0;
capability = le16_to_cpu(bss->a.capabilities); beacon_interval = le16_to_cpu(bss->a.beacon_interv);

#1 lore raw
Quoted 1 line · Joe Gunn

If the frequency can not be mapped to a channel structure log it and drop it.

FWIW, the Signed-off-by goes here. No need to repost, I'll fix it...

Quoted 34 lines

---
The driver was getting an error return from the frequency map. The invalid freq uency was not in the frequency table, so the channel structure returned null. T his test fro that case and does not allow the packet to continue up the stack.
---

drivers/net/wireless/orinoco renamed from drivers/net/wireless/orinoco/scan.c +0 -0

/scan.c
index 86cb54c..e99ca1c 100644

drivers/net/wireless/orinoco/scan.c +5 -0
@@ -111,6 +111,11 @@ static void orinoco_add_hostscan_result(struct orinoco_pri
 vate *priv,
 
 	freq = ieee80211_dsss_chan_to_freq(le16_to_cpu(bss->a.channel));
 	channel = ieee80211_get_channel(wiphy, freq);
+	if (!channel) {
+		printk(KERN_DEBUG "Invalid channel designation %04X(%04X)",
+			bss->a.channel, freq);
+		return;	/* Then ignore it for now */
+	}
 	timestamp = 0;
 	capability = le16_to_cpu(bss->a.capabilities);

beacon_interval = le16_to_cpu(bss->a.beacon_interv);

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.