In the SoftMAC version of the IEEE 802.11 stack, not all duplicate messages are
detected. For the most part, there is no difficulty; however ifor TKIP and CCMP
encryption, the duplicates result in a "replay detected" log message where the
received and previous values of the TSC are identical. This change adds a new
variable to the ieee80211_device structure that holds the 'seq_ctl' value for
the previous frame. When a new frame repeats the value, the frame is dropped and
the appropriate counter is incremented.

Signed-off-by: Larry Finger <[EMAIL PROTECTED]>
---

John,

This patch replaces the one that I originally sent on 9/25. This version logs 
the
dropped packets, which addresses the objections to the previous one.

Larry


Index: wireless-2.6/net/ieee80211/ieee80211_rx.c
===================================================================
--- wireless-2.6.orig/net/ieee80211/ieee80211_rx.c
+++ wireless-2.6/net/ieee80211/ieee80211_rx.c
@@ -479,6 +479,11 @@ int ieee80211_rx(struct ieee80211_device
                        goto rx_exit;
        }
 #endif
+       /* drop duplicate 802.11 retransmissions (IEEE 802.11 Chap. 9.29) */
+       if (sc == ieee->prev_seq_ctl)
+               goto rx_dropped;
+       else
+               ieee->prev_seq_ctl = sc;
 
        /* Data frame - extract src/dst addresses */
        if (skb->len < IEEE80211_3ADDR_LEN)
Index: wireless-2.6/include/net/ieee80211.h
===================================================================
--- wireless-2.6.orig/include/net/ieee80211.h
+++ wireless-2.6/include/net/ieee80211.h
@@ -1076,6 +1076,8 @@ struct ieee80211_device {
        int perfect_rssi;
        int worst_rssi;
 
+       u16 prev_seq_ctl;       /* used to drop duplicate frames */
+
        /* Callback functions */
        void (*set_security) (struct net_device * dev,
                              struct ieee80211_security * sec);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to