Changeset 1728

Show
Ignore:
Timestamp:
09/22/06 19:33:57 (2 years ago)
Author:
mentor
Message:

Set Packet Type correctly in monitor mode frames
Signed-off-by: Scott Raynel <scottraynel@gmail.com>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/net80211/ieee80211_monitor.c

    r1721 r1728  
    214214        int noise = 0; 
    215215        u_int32_t rssi = 0; 
     216        u_int8_t pkttype = 0; 
    216217         
    217218        rssi = tx ? ds->ds_txstat.ts_rssi : ds->ds_rxstat.rs_rssi; 
     
    227228                struct ieee80211_frame *wh = (struct ieee80211_frame *)skb->data; 
    228229                u_int8_t dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; 
     230 
     231                if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { 
     232                        if (IEEE80211_ADDR_EQ(wh->i_addr1, dev->broadcast)) 
     233                                pkttype = PACKET_BROADCAST; 
     234                        else 
     235                                pkttype = PACKET_MULTICAST; 
     236                } else if (tx) 
     237                        pkttype = PACKET_OUTGOING; 
     238                else 
     239                        pkttype = PACKET_HOST; 
    229240 
    230241                next = TAILQ_NEXT(vap, iv_next); 
     
    427438                        skb1->mac.raw = skb1->data; 
    428439                        skb1->ip_summed = CHECKSUM_NONE; 
    429                         skb1->pkt_type = PACKET_OTHERHOST
     440                        skb1->pkt_type = pkttype
    430441                        skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ 
    431442