Ticket #921: madwifi_monitor_invalid_frames.patch
| File madwifi_monitor_invalid_frames.patch, 3.6 kB (added by scottraynel@gmail.com, 6 years ago) |
|---|
-
net80211/ieee80211_monitor.c
old new 247 247 /* don't rx fromds, tods, or dstods packets */ 248 248 continue; 249 249 } 250 251 /* If we have rx'd an error frame... */ 252 if (!tx && ds->ds_rxstat.rs_status != 0) { 253 /* If the vap does not want error frames and 254 * the error was not a crypto error (which we 255 * let through regardless), drop the frame */ 256 if (vap->iv_monitor_invalid_frames == 0 && 257 (ds->ds_rxstat.rs_status &~ 258 (HAL_RXERR_DECRYPT|HAL_RXERR_MIC))) { 259 continue; 260 } 261 } 262 250 263 skb1 = skb_copy(skb, GFP_ATOMIC); 251 264 if (skb1 == NULL) { 252 265 /* XXX stat+msg */ -
net80211/ieee80211_var.h
old new 313 313 314 314 int iv_monitor_nods_only; /* in monitor mode only nods traffic */ 315 315 int iv_monitor_txf_len; /* in monitor mode, truncate tx packets */ 316 int iv_monitor_invalid_frames; /* in monitor mode, accept error frames */ 316 317 317 318 int (*iv_newstate)(struct ieee80211vap *, enum ieee80211_state, int); 318 319 u_int8_t iv_myaddr[IEEE80211_ADDR_LEN]; -
net80211/ieee80211_linux.c
old new 546 546 } 547 547 return ret; 548 548 } 549 static int 550 IEEE80211_SYSCTL_DECL(ieee80211_sysctl_monitor_invalid_frames, ctl, write, filp, buffer, 551 lenp, ppos) 552 { 553 struct ieee80211vap *vap = ctl->extra1; 554 u_int val; 555 int ret; 549 556 557 ctl->data = &val; 558 ctl->maxlen = sizeof(val); 559 if (write) { 560 ret = IEEE80211_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, 561 lenp, ppos); 562 if (ret == 0) 563 vap->iv_monitor_invalid_frames = val; 564 } else { 565 val = vap->iv_monitor_invalid_frames; 566 ret = IEEE80211_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, 567 lenp, ppos); 568 } 569 return ret; 570 } 571 572 550 573 #define CTL_AUTO -2 /* cannot be CTL_ANY or CTL_NONE */ 551 574 552 575 static const ctl_table ieee80211_sysctl_template[] = { … … 572 595 .mode = 0644, 573 596 .proc_handler = ieee80211_sysctl_monitor_txf_len 574 597 }, 598 { .ctl_name = CTL_AUTO, 599 .procname = "monitor_invalid_frames", 600 .mode = 0644, 601 .proc_handler = ieee80211_sysctl_monitor_invalid_frames 602 }, 575 603 /* NB: must be last entry before NULL */ 576 604 { .ctl_name = CTL_AUTO, 577 605 .procname = "%parent", -
ath/if_ath.c
old new 5502 5502 #endif 5503 5503 } 5504 5504 } 5505 /* 5506 * Reject error frames, we normally don't want 5507 * to see them in monitor mode (in monitor mode 5508 * allow through packets that have crypto problems). 5505 /* 5506 * Error frame rejection is now done after frames 5507 * are passed to the monitor mode vaps as some 5508 * monitor mode vaps may want to process error frames. 5509 * Filtering of frames with crypto problems is now 5510 * done in ieee80211_input_monitor 5509 5511 */ 5510 if ((ds->ds_rxstat.rs_status &~ 5511 (HAL_RXERR_DECRYPT|HAL_RXERR_MIC)) || 5512 sc->sc_ic.ic_opmode != IEEE80211_M_MONITOR) 5512 if (sc->sc_nmonvaps == 0) 5513 5513 goto rx_next; 5514 5514 } 5515 5515 rx_accept: … … 5558 5558 } 5559 5559 } 5560 5560 5561 /* Reject error frames */ 5562 if (ds->ds_rxstat.rs_status != 0) { 5563 dev_kfree_skb(skb); 5564 skb = NULL; 5565 goto rx_next; 5566 } 5567 5561 5568 /* remove the crc */ 5562 5569 skb_trim(skb, skb->len - IEEE80211_CRC_LEN); 5563 5570
