]> err.no Git - linux-2.6/blobdiff - net/ieee80211/ieee80211_rx.c
[NETFILTER]: Add support for permanent expectations
[linux-2.6] / net / ieee80211 / ieee80211_rx.c
index 2bda8a1748181ffca5e80a7b4279766e0c69121b..a5905f53aed7d377bf29f4a3685def68bbe3b421 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/netdevice.h>
-#include <linux/pci.h>
 #include <linux/proc_fs.h>
 #include <linux/skbuff.h>
 #include <linux/slab.h>
@@ -440,7 +439,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                              crypt->ops->decrypt_mpdu == NULL))
                        crypt = NULL;
 
-               if (!crypt && (fc & IEEE80211_FCTL_WEP)) {
+               if (!crypt && (fc & IEEE80211_FCTL_PROTECTED)) {
                        /* This seems to be triggered by some (multicast?)
                         * frames from other than current BSS, so just drop the
                         * frames silently instead of filling system log with
@@ -456,7 +455,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 #ifdef NOT_YET
        if (type != WLAN_FC_TYPE_DATA) {
                if (type == WLAN_FC_TYPE_MGMT && stype == WLAN_FC_STYPE_AUTH &&
-                   fc & IEEE80211_FCTL_WEP && ieee->host_decrypt &&
+                   fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt &&
                    (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0)
                {
                        printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
@@ -475,7 +474,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 #endif
 
        /* Data frame - extract src/dst addresses */
-       if (skb->len < IEEE80211_DATA_HDR3_LEN)
+       if (skb->len < IEEE80211_3ADDR_LEN)
                goto rx_dropped;
 
        switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) {
@@ -488,7 +487,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                memcpy(src, hdr->addr2, ETH_ALEN);
                break;
        case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS:
-               if (skb->len < IEEE80211_DATA_HDR4_LEN)
+               if (skb->len < IEEE80211_4ADDR_LEN)
                        goto rx_dropped;
                memcpy(dst, hdr->addr3, ETH_ALEN);
                memcpy(src, hdr->addr4, ETH_ALEN);
@@ -557,7 +556,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 
        /* skb: hdr + (possibly fragmented, possibly encrypted) payload */
 
-       if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
+       if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
            (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0)
                goto rx_dropped;
 
@@ -565,7 +564,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 
        /* skb: hdr + (possibly fragmented) plaintext payload */
        // PR: FIXME: hostap has additional conditions in the "if" below:
-       // ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
+       // ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
        if ((frag != 0 || (fc & IEEE80211_FCTL_MOREFRAGS))) {
                int flen;
                struct sk_buff *frag_skb = ieee80211_frag_cache_get(ieee, hdr);
@@ -621,22 +620,16 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 
        /* skb: hdr + (possible reassembled) full MSDU payload; possibly still
         * encrypted/authenticated */
-       if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
+       if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
            ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt))
                goto rx_dropped;
 
        hdr = (struct ieee80211_hdr *) skb->data;
-       if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep) {
+       if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep) {
                if (/*ieee->ieee802_1x &&*/
                    ieee80211_is_eapol_frame(ieee, skb)) {
-#ifdef CONFIG_IEEE80211_DEBUG
                        /* pass unencrypted EAPOL frames even if encryption is
                         * configured */
-                       struct eapol *eap = (struct eapol *)(skb->data +
-                               24);
-                       IEEE80211_DEBUG_EAP("RX: IEEE 802.1X EAPOL frame: %s\n",
-                                               eap_get_type(eap->type));
-#endif
                } else {
                        IEEE80211_DEBUG_DROP(
                                "encryption configured, but RX "
@@ -646,17 +639,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                }
        }
 
-#ifdef CONFIG_IEEE80211_DEBUG
-       if (crypt && !(fc & IEEE80211_FCTL_WEP) &&
-           ieee80211_is_eapol_frame(ieee, skb)) {
-                       struct eapol *eap = (struct eapol *)(skb->data +
-                               24);
-                       IEEE80211_DEBUG_EAP("RX: IEEE 802.1X EAPOL frame: %s\n",
-                                               eap_get_type(eap->type));
-       }
-#endif
-
-       if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep &&
+       if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep &&
            !ieee80211_is_eapol_frame(ieee, skb)) {
                IEEE80211_DEBUG_DROP(
                        "dropped unencrypted RX data "
@@ -848,7 +831,7 @@ static inline int ieee80211_network_init(
        left = stats->len - ((void *)info_element - (void *)beacon);
        while (left >= sizeof(struct ieee80211_info_element_hdr)) {
                if (sizeof(struct ieee80211_info_element_hdr) + info_element->len > left) {
-                       IEEE80211_DEBUG_SCAN("SCAN: parse failed: info_element->len + 2 > left : info_element->len+2=%d left=%d.\n",
+                       IEEE80211_DEBUG_SCAN("SCAN: parse failed: info_element->len + 2 > left : info_element->len+2=%Zd left=%d.\n",
                                             info_element->len + sizeof(struct ieee80211_info_element),
                                             left);
                        return 1;