aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-25 20:31:13 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-25 20:31:13 -0400
commitb4bf343093e81e33d75bede45896eda52cd5f2b4 (patch)
tree7fd5ce5f428995e6d612014e3ca7ad3f917fcf65 /net
parent343b0597297c3190647854881c087c01faf40a6f (diff)
parent099c5bb169e9816a7761336f668b63010762807b (diff)
/spare/repo/netdev-2.6 branch 'ieee80211'
Diffstat (limited to 'net')
-rw-r--r--net/ieee80211/ieee80211_module.c26
-rw-r--r--net/ieee80211/ieee80211_rx.c16
-rw-r--r--net/ieee80211/ieee80211_tx.c2
3 files changed, 35 insertions, 9 deletions
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
index e0802b8755a0..553acb2e93d5 100644
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -269,5 +269,31 @@ module_exit(ieee80211_exit);
269module_init(ieee80211_init); 269module_init(ieee80211_init);
270#endif 270#endif
271 271
272
273const char *escape_essid(const char *essid, u8 essid_len) {
274 static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
275 const char *s = essid;
276 char *d = escaped;
277
278 if (ieee80211_is_empty_essid(essid, essid_len)) {
279 memcpy(escaped, "<hidden>", sizeof("<hidden>"));
280 return escaped;
281 }
282
283 essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE);
284 while (essid_len--) {
285 if (*s == '\0') {
286 *d++ = '\\';
287 *d++ = '0';
288 s++;
289 } else {
290 *d++ = *s++;
291 }
292 }
293 *d = '\0';
294 return escaped;
295}
296
272EXPORT_SYMBOL(alloc_ieee80211); 297EXPORT_SYMBOL(alloc_ieee80211);
273EXPORT_SYMBOL(free_ieee80211); 298EXPORT_SYMBOL(free_ieee80211);
299EXPORT_SYMBOL(escape_essid);
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 0dd102993ef4..9505f3167aeb 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -439,7 +439,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
439 crypt->ops->decrypt_mpdu == NULL)) 439 crypt->ops->decrypt_mpdu == NULL))
440 crypt = NULL; 440 crypt = NULL;
441 441
442 if (!crypt && (fc & IEEE80211_FCTL_WEP)) { 442 if (!crypt && (fc & IEEE80211_FCTL_PROTECTED)) {
443 /* This seems to be triggered by some (multicast?) 443 /* This seems to be triggered by some (multicast?)
444 * frames from other than current BSS, so just drop the 444 * frames from other than current BSS, so just drop the
445 * frames silently instead of filling system log with 445 * frames silently instead of filling system log with
@@ -455,7 +455,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
455#ifdef NOT_YET 455#ifdef NOT_YET
456 if (type != WLAN_FC_TYPE_DATA) { 456 if (type != WLAN_FC_TYPE_DATA) {
457 if (type == WLAN_FC_TYPE_MGMT && stype == WLAN_FC_STYPE_AUTH && 457 if (type == WLAN_FC_TYPE_MGMT && stype == WLAN_FC_STYPE_AUTH &&
458 fc & IEEE80211_FCTL_WEP && ieee->host_decrypt && 458 fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt &&
459 (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) 459 (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0)
460 { 460 {
461 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 461 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
@@ -556,7 +556,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
556 556
557 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */ 557 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */
558 558
559 if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && 559 if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
560 (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) 560 (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0)
561 goto rx_dropped; 561 goto rx_dropped;
562 562
@@ -564,7 +564,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
564 564
565 /* skb: hdr + (possibly fragmented) plaintext payload */ 565 /* skb: hdr + (possibly fragmented) plaintext payload */
566 // PR: FIXME: hostap has additional conditions in the "if" below: 566 // PR: FIXME: hostap has additional conditions in the "if" below:
567 // ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && 567 // ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
568 if ((frag != 0 || (fc & IEEE80211_FCTL_MOREFRAGS))) { 568 if ((frag != 0 || (fc & IEEE80211_FCTL_MOREFRAGS))) {
569 int flen; 569 int flen;
570 struct sk_buff *frag_skb = ieee80211_frag_cache_get(ieee, hdr); 570 struct sk_buff *frag_skb = ieee80211_frag_cache_get(ieee, hdr);
@@ -620,12 +620,12 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
620 620
621 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still 621 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still
622 * encrypted/authenticated */ 622 * encrypted/authenticated */
623 if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && 623 if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
624 ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) 624 ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt))
625 goto rx_dropped; 625 goto rx_dropped;
626 626
627 hdr = (struct ieee80211_hdr *) skb->data; 627 hdr = (struct ieee80211_hdr *) skb->data;
628 if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep) { 628 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep) {
629 if (/*ieee->ieee802_1x &&*/ 629 if (/*ieee->ieee802_1x &&*/
630 ieee80211_is_eapol_frame(ieee, skb)) { 630 ieee80211_is_eapol_frame(ieee, skb)) {
631#ifdef CONFIG_IEEE80211_DEBUG 631#ifdef CONFIG_IEEE80211_DEBUG
@@ -646,7 +646,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
646 } 646 }
647 647
648#ifdef CONFIG_IEEE80211_DEBUG 648#ifdef CONFIG_IEEE80211_DEBUG
649 if (crypt && !(fc & IEEE80211_FCTL_WEP) && 649 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) &&
650 ieee80211_is_eapol_frame(ieee, skb)) { 650 ieee80211_is_eapol_frame(ieee, skb)) {
651 struct eapol *eap = (struct eapol *)(skb->data + 651 struct eapol *eap = (struct eapol *)(skb->data +
652 24); 652 24);
@@ -655,7 +655,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
655 } 655 }
656#endif 656#endif
657 657
658 if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep && 658 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep &&
659 !ieee80211_is_eapol_frame(ieee, skb)) { 659 !ieee80211_is_eapol_frame(ieee, skb)) {
660 IEEE80211_DEBUG_DROP( 660 IEEE80211_DEBUG_DROP(
661 "dropped unencrypted RX data " 661 "dropped unencrypted RX data "
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
index d1049edcd14d..071d093f2989 100644
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -313,7 +313,7 @@ int ieee80211_xmit(struct sk_buff *skb,
313 313
314 if (encrypt) 314 if (encrypt)
315 fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA | 315 fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA |
316 IEEE80211_FCTL_WEP; 316 IEEE80211_FCTL_PROTECTED;
317 else 317 else
318 fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA; 318 fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA;
319 319