diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-04 10:16:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-04 10:16:00 -0400 |
commit | 0e833d8cfcb52b5ee3ead22cabbab81dea32c3f0 (patch) | |
tree | 0c64533ba9181c014a4b2dcda75c273ae0437dd6 /net/wireless/scan.c | |
parent | 4f1ba49efafccbc73017f824efa2505c81b247cd (diff) | |
parent | 7b29dc21ea084be7ddfb536994a9cfae95337690 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (40 commits)
tg3: Fix tg3_skb_error_unmap()
net: tracepoint of net_dev_xmit sees freed skb and causes panic
drivers/net/can/flexcan.c: add missing clk_put
net: dm9000: Get the chip in a known good state before enabling interrupts
drivers/net/davinci_emac.c: add missing clk_put
af-packet: Add flag to distinguish VID 0 from no-vlan.
caif: Fix race when conditionally taking rtnl lock
usbnet/cdc_ncm: add missing .reset_resume hook
vlan: fix typo in vlan_dev_hard_start_xmit()
net/ipv4: Check for mistakenly passed in non-IPv4 address
iwl4965: correctly validate temperature value
bluetooth l2cap: fix locking in l2cap_global_chan_by_psm
ath9k: fix two more bugs in tx power
cfg80211: don't drop p2p probe responses
Revert "net: fix section mismatches"
drivers/net/usb/catc.c: Fix potential deadlock in catc_ctrl_run()
sctp: stop pending timers and purge queues when peer restart asoc
drivers/net: ks8842 Fix crash on received packet when in PIO mode.
ip_options_compile: properly handle unaligned pointer
iwlagn: fix incorrect PCI subsystem id for 6150 devices
...
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r-- | net/wireless/scan.c | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 73a441d237b5..7a6c67667d70 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -267,13 +267,35 @@ static bool is_bss(struct cfg80211_bss *a, | |||
267 | return memcmp(ssidie + 2, ssid, ssid_len) == 0; | 267 | return memcmp(ssidie + 2, ssid, ssid_len) == 0; |
268 | } | 268 | } |
269 | 269 | ||
270 | static bool is_mesh_bss(struct cfg80211_bss *a) | ||
271 | { | ||
272 | const u8 *ie; | ||
273 | |||
274 | if (!WLAN_CAPABILITY_IS_STA_BSS(a->capability)) | ||
275 | return false; | ||
276 | |||
277 | ie = cfg80211_find_ie(WLAN_EID_MESH_ID, | ||
278 | a->information_elements, | ||
279 | a->len_information_elements); | ||
280 | if (!ie) | ||
281 | return false; | ||
282 | |||
283 | ie = cfg80211_find_ie(WLAN_EID_MESH_CONFIG, | ||
284 | a->information_elements, | ||
285 | a->len_information_elements); | ||
286 | if (!ie) | ||
287 | return false; | ||
288 | |||
289 | return true; | ||
290 | } | ||
291 | |||
270 | static bool is_mesh(struct cfg80211_bss *a, | 292 | static bool is_mesh(struct cfg80211_bss *a, |
271 | const u8 *meshid, size_t meshidlen, | 293 | const u8 *meshid, size_t meshidlen, |
272 | const u8 *meshcfg) | 294 | const u8 *meshcfg) |
273 | { | 295 | { |
274 | const u8 *ie; | 296 | const u8 *ie; |
275 | 297 | ||
276 | if (!WLAN_CAPABILITY_IS_MBSS(a->capability)) | 298 | if (!WLAN_CAPABILITY_IS_STA_BSS(a->capability)) |
277 | return false; | 299 | return false; |
278 | 300 | ||
279 | ie = cfg80211_find_ie(WLAN_EID_MESH_ID, | 301 | ie = cfg80211_find_ie(WLAN_EID_MESH_ID, |
@@ -311,7 +333,7 @@ static int cmp_bss(struct cfg80211_bss *a, | |||
311 | if (a->channel != b->channel) | 333 | if (a->channel != b->channel) |
312 | return b->channel->center_freq - a->channel->center_freq; | 334 | return b->channel->center_freq - a->channel->center_freq; |
313 | 335 | ||
314 | if (WLAN_CAPABILITY_IS_MBSS(a->capability | b->capability)) { | 336 | if (is_mesh_bss(a) && is_mesh_bss(b)) { |
315 | r = cmp_ies(WLAN_EID_MESH_ID, | 337 | r = cmp_ies(WLAN_EID_MESH_ID, |
316 | a->information_elements, | 338 | a->information_elements, |
317 | a->len_information_elements, | 339 | a->len_information_elements, |
@@ -457,7 +479,6 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, | |||
457 | struct cfg80211_internal_bss *res) | 479 | struct cfg80211_internal_bss *res) |
458 | { | 480 | { |
459 | struct cfg80211_internal_bss *found = NULL; | 481 | struct cfg80211_internal_bss *found = NULL; |
460 | const u8 *meshid, *meshcfg; | ||
461 | 482 | ||
462 | /* | 483 | /* |
463 | * The reference to "res" is donated to this function. | 484 | * The reference to "res" is donated to this function. |
@@ -470,22 +491,6 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, | |||
470 | 491 | ||
471 | res->ts = jiffies; | 492 | res->ts = jiffies; |
472 | 493 | ||
473 | if (WLAN_CAPABILITY_IS_MBSS(res->pub.capability)) { | ||
474 | /* must be mesh, verify */ | ||
475 | meshid = cfg80211_find_ie(WLAN_EID_MESH_ID, | ||
476 | res->pub.information_elements, | ||
477 | res->pub.len_information_elements); | ||
478 | meshcfg = cfg80211_find_ie(WLAN_EID_MESH_CONFIG, | ||
479 | res->pub.information_elements, | ||
480 | res->pub.len_information_elements); | ||
481 | if (!meshid || !meshcfg || | ||
482 | meshcfg[1] != sizeof(struct ieee80211_meshconf_ie)) { | ||
483 | /* bogus mesh */ | ||
484 | kref_put(&res->ref, bss_release); | ||
485 | return NULL; | ||
486 | } | ||
487 | } | ||
488 | |||
489 | spin_lock_bh(&dev->bss_lock); | 494 | spin_lock_bh(&dev->bss_lock); |
490 | 495 | ||
491 | found = rb_find_bss(dev, res); | 496 | found = rb_find_bss(dev, res); |