lkml.org 
[lkml]   [2010]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[063/200] mac80211: fix rts threshold check
    2.6.34-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Shanyu Zhao <shanyu.zhao@intel.com>

    commit a2c40249a36d0b4d76d1caf6bf806e4ae5b06e8a upstream.

    Currently whenever rts thresold is set, every packet will use RTS
    protection no matter its size exceeds the threshold or not. This is
    due to a bug in the rts threshold check.
    if (len > tx->local->hw.wiphy->rts_threshold) {
    txrc.rts = rts = true;
    }
    Basically it is comparing an int (len) and a u32 (rts_threshold),
    and the variable len is assigned as:
    len = min_t(int, tx->skb->len + FCS_LEN,
    tx->local->hw.wiphy->frag_threshold);
    However, when frag_threshold is "-1", len is always "-1", which is
    0xffffffff therefore rts is always set to true.

    Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
    Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    net/mac80211/tx.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    --- a/net/mac80211/tx.c
    +++ b/net/mac80211/tx.c
    @@ -584,7 +584,8 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
    struct ieee80211_hdr *hdr = (void *)tx->skb->data;
    struct ieee80211_supported_band *sband;
    struct ieee80211_rate *rate;
    - int i, len;
    + int i;
    + u32 len;
    bool inval = false, rts = false, short_preamble = false;
    struct ieee80211_tx_rate_control txrc;
    u32 sta_flags;
    @@ -593,7 +594,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021

    sband = tx->local->hw.wiphy->bands[tx->channel->band];

    - len = min_t(int, tx->skb->len + FCS_LEN,
    + len = min_t(u32, tx->skb->len + FCS_LEN,
    tx->local->hw.wiphy->frag_threshold);

    /* set up the tx rate control struct we give the RC algo */



    \
     
     \ /
      Last update: 2010-07-01 23:55    [W:0.027 / U:59.852 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site