tree 878cb9f93b541af1e6ed4653a58640bb5acf7713
parent 5f55d0850e4ae0b4bfabc9a372af5b9f52be02da
author Jouni Malinen <[EMAIL PROTECTED]> Mon, 29 Aug 2005 00:51:33 -0700
committer Jeff Garzik <[EMAIL PROTECTED]> Mon, 29 Aug 2005 03:23:07 -0400

[PATCH] ieee80211: Remove EAPOL debug

IEEE 802.11 code has no business touching payloads of EAPOL frames.
There are some EAPOL structures defined for debugging and these were
confusingly called EAP types which they are not. Let's just remove these
before someone else starts using them in the kernel.

Signed-off-by: Jouni Malinen <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>

 include/net/ieee80211.h      |   31 -------------------------------
 net/ieee80211/ieee80211_rx.c |   16 ----------------
 net/ieee80211/ieee80211_tx.c |    9 ---------
 3 files changed, 56 deletions(-)

diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -56,35 +56,6 @@ struct ieee80211_hdr_3addr {
        __le16 seq_ctl;
 } __attribute__ ((packed));
 
-enum eap_type {
-       EAP_PACKET = 0,
-       EAPOL_START,
-       EAPOL_LOGOFF,
-       EAPOL_KEY,
-       EAPOL_ENCAP_ASF_ALERT
-};
-
-static const char *eap_types[] = {
-       [EAP_PACKET]            = "EAP-Packet",
-       [EAPOL_START]           = "EAPOL-Start",
-       [EAPOL_LOGOFF]          = "EAPOL-Logoff",
-       [EAPOL_KEY]             = "EAPOL-Key",
-       [EAPOL_ENCAP_ASF_ALERT] = "EAPOL-Encap-ASF-Alert"
-};
-
-static inline const char *eap_get_type(int type)
-{
-       return (type >= ARRAY_SIZE(eap_types)) ? "Unknown" : eap_types[type];
-}
-
-struct eapol {
-       u8 snap[6];
-       __be16 ethertype;
-       u8 version;
-       u8 type;
-       __be16 length;
-} __attribute__ ((packed));
-
 #define IEEE80211_1ADDR_LEN 10
 #define IEEE80211_2ADDR_LEN 16
 #define IEEE80211_3ADDR_LEN 24
@@ -202,7 +173,6 @@ const char *escape_essid(const char *ess
 #define IEEE80211_DL_STATE         (1<<3)
 #define IEEE80211_DL_MGMT          (1<<4)
 #define IEEE80211_DL_FRAG          (1<<5)
-#define IEEE80211_DL_EAP           (1<<6)
 #define IEEE80211_DL_DROP          (1<<7)
 
 #define IEEE80211_DL_TX            (1<<8)
@@ -217,7 +187,6 @@ const char *escape_essid(const char *ess
 #define IEEE80211_DEBUG_STATE(f, a...)  IEEE80211_DEBUG(IEEE80211_DL_STATE, f, 
## a)
 #define IEEE80211_DEBUG_MGMT(f, a...)  IEEE80211_DEBUG(IEEE80211_DL_MGMT, f, 
## a)
 #define IEEE80211_DEBUG_FRAG(f, a...)  IEEE80211_DEBUG(IEEE80211_DL_FRAG, f, 
## a)
-#define IEEE80211_DEBUG_EAP(f, a...)  IEEE80211_DEBUG(IEEE80211_DL_EAP, f, ## 
a)
 #define IEEE80211_DEBUG_DROP(f, a...)  IEEE80211_DEBUG(IEEE80211_DL_DROP, f, 
## a)
 #define IEEE80211_DEBUG_TX(f, a...)  IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a)
 #define IEEE80211_DEBUG_RX(f, a...)  IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -628,14 +628,8 @@ int ieee80211_rx(struct ieee80211_device
        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 "
@@ -645,16 +639,6 @@ int ieee80211_rx(struct ieee80211_device
                }
        }
 
-#ifdef CONFIG_IEEE80211_DEBUG
-       if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) &&
-           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_PROTECTED) && !ieee->open_wep &&
            !ieee80211_is_eapol_frame(ieee, skb)) {
                IEEE80211_DEBUG_DROP(
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -292,15 +292,6 @@ int ieee80211_xmit(struct sk_buff *skb,
                goto success;
        }
 
-#ifdef CONFIG_IEEE80211_DEBUG
-       if (crypt && !encrypt && ether_type == ETH_P_PAE) {
-               struct eapol *eap = (struct eapol *)(skb->data +
-                       sizeof(struct ethhdr) - SNAP_SIZE - sizeof(u16));
-               IEEE80211_DEBUG_EAP("TX: IEEE 802.11 EAPOL frame: %s\n",
-                       eap_get_type(eap->type));
-       }
-#endif
-
        /* Save source and destination addresses */
        memcpy(&dest, skb->data, ETH_ALEN);
        memcpy(&src, skb->data+ETH_ALEN, ETH_ALEN);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to