Ticket #906: madwifi_monitor_direction.patch
| File madwifi_monitor_direction.patch, 1.2 kB (added by scottraynel@gmail.com, 2 years ago) |
|---|
-
net80211/ieee80211_monitor.c
old new 213 213 struct ieee80211vap *vap, *next; 214 214 int noise = 0; 215 215 u_int32_t rssi = 0; 216 u_int8_t pkttype = 0; 216 217 217 218 rssi = tx ? ds->ds_txstat.ts_rssi : ds->ds_rxstat.rs_rssi; 218 219 … … 225 226 struct sk_buff *skb1; 226 227 struct net_device *dev = vap->iv_dev; 227 228 struct ieee80211_frame *wh = (struct ieee80211_frame *)skb->data; 229 230 if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { 231 if (memcmp(wh->i_addr1, dev->broadcast, ETH_ALEN) == 0) 232 pkttype = PACKET_BROADCAST; 233 else 234 pkttype = PACKET_MULTICAST; 235 } 236 else if (tx) 237 pkttype = PACKET_OUTGOING; 238 else 239 pkttype = PACKET_HOST; 240 228 241 u_int8_t dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; 229 242 230 243 next = TAILQ_NEXT(vap, iv_next); … … 426 439 skb1->dev = dev; /* NB: deliver to wlanX */ 427 440 skb1->mac.raw = skb1->data; 428 441 skb1->ip_summed = CHECKSUM_NONE; 429 skb1->pkt_type = PACKET_OTHERHOST;442 skb1->pkt_type = pkttype; 430 443 skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ 431 444 432 445 netif_rx(skb1);
