[Madwifi-cvs] revision 2116 committed
Status: Beta
Brought to you by:
otaku
From: Scott R. <svn...@ma...> - 2007-02-14 23:46:02
|
Project : madwifi Revision : 2116 Author : scottr (Scott Raynel) Date : 2007-02-15 00:45:48 +0100 (Thu, 15 Feb 2007) Log Message : In monitor mode, check the skb len before trimming the FCS. Affected Files: * trunk/net80211/ieee80211_monitor.c updated Modified: trunk/net80211/ieee80211_monitor.c =================================================================== --- trunk/net80211/ieee80211_monitor.c 2007-02-14 04:41:48 UTC (rev 2115) +++ trunk/net80211/ieee80211_monitor.c 2007-02-14 23:45:48 UTC (rev 2116) @@ -527,7 +527,11 @@ th->wr_dbm_antsignal = th->wr_dbm_antnoise + rssi; th->wr_antenna = ds->ds_rxstat.rs_antenna; th->wr_antsignal = rssi; - th->wr_fcs = cpu_to_le32p((u32 *)&skb1->data[skb1->len - IEEE80211_CRC_LEN]); + if (skb->len >= IEEE80211_CRC_LEN) + th->wr_fcs = cpu_to_le32p((u32 *)&skb1->data[skb1->len - IEEE80211_CRC_LEN]); + else + th->wr_fcs = 0; + th->wr_tsft = cpu_to_le64(mactime); } break; @@ -546,7 +550,7 @@ break; } if (skb1) { - if (!tx) { + if (!tx && skb->len >= IEEE80211_CRC_LEN) { /* Remove FCS from end of rx frames*/ skb_trim(skb1, skb1->len - IEEE80211_CRC_LEN); } |