diff options
author | sam <sam@FreeBSD.org> | 2009-06-02 00:33:28 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-06-02 00:33:28 +0000 |
commit | 35d42ca22fe811992438e1615568d4e7635edba0 (patch) | |
tree | ccf8dc084c04cab525bd2e37c6e5fc02f735b98b /sys/net80211/ieee80211_freebsd.c | |
parent | 97e535876ee2651cea94436136470eb9445e3f95 (diff) | |
download | FreeBSD-src-35d42ca22fe811992438e1615568d4e7635edba0.zip FreeBSD-src-35d42ca22fe811992438e1615568d4e7635edba0.tar.gz |
Fix monitor mode vaps to work as intended:
o track # bpf taps on monitor mode vaps instead of # monitor mode vaps
o spam monitor mode taps on tx/rx
o fix ieee80211_radiotap_rx_all to dispatch frames only if the vap is up
o while here print radiotap (and superg) state in show com
Diffstat (limited to 'sys/net80211/ieee80211_freebsd.c')
-rw-r--r-- | sys/net80211/ieee80211_freebsd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c index 0dfa4a9..481ef881 100644 --- a/sys/net80211/ieee80211_freebsd.c +++ b/sys/net80211/ieee80211_freebsd.c @@ -706,11 +706,16 @@ bpf_track(void *arg, struct ifnet *ifp, int dlt, int attach) * vap. This flag is used by drivers to prepare radiotap * state only when needed. */ - if (attach) + if (attach) { ieee80211_syncflag_ext(vap, IEEE80211_FEXT_BPF); + if (vap->iv_opmode == IEEE80211_M_MONITOR) + atomic_add_int(&vap->iv_ic->ic_montaps, 1); /* NB: if_softc is NULL on vap detach */ - else if (vap != NULL && !bpf_peers_present(vap->iv_rawbpf)) + } else if (vap != NULL && !bpf_peers_present(vap->iv_rawbpf)) { ieee80211_syncflag_ext(vap, -IEEE80211_FEXT_BPF); + if (vap->iv_opmode == IEEE80211_M_MONITOR) + atomic_subtract_int(&vap->iv_ic->ic_montaps, 1); + } } } |