o use shared code to handle bpf tap and mbuf cleanup
o swap conditional order to put the cheapest first
This commit is contained in:
parent
151f899628
commit
4ce505aeb1
@ -637,11 +637,8 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
vap->iv_stats.is_rx_mgtdiscard++; /* XXX */
|
||||
goto out;
|
||||
}
|
||||
if (bpf_peers_present(vap->iv_rawbpf))
|
||||
bpf_mtap(vap->iv_rawbpf, m);
|
||||
vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp);
|
||||
m_freem(m);
|
||||
return IEEE80211_FC0_TYPE_MGT;
|
||||
goto out;
|
||||
|
||||
case IEEE80211_FC0_TYPE_CTL:
|
||||
vap->iv_stats.is_rx_ctl++;
|
||||
@ -657,7 +654,7 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
ifp->if_ierrors++;
|
||||
out:
|
||||
if (m != NULL) {
|
||||
if (bpf_peers_present(vap->iv_rawbpf) && need_tap)
|
||||
if (need_tap && bpf_peers_present(vap->iv_rawbpf))
|
||||
bpf_mtap(vap->iv_rawbpf, m);
|
||||
m_freem(m);
|
||||
}
|
||||
|
@ -831,11 +831,8 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
wh = mtod(m, struct ieee80211_frame *);
|
||||
wh->i_fc[1] &= ~IEEE80211_FC1_WEP;
|
||||
}
|
||||
if (bpf_peers_present(vap->iv_rawbpf))
|
||||
bpf_mtap(vap->iv_rawbpf, m);
|
||||
vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp);
|
||||
m_freem(m);
|
||||
return IEEE80211_FC0_TYPE_MGT;
|
||||
goto out;
|
||||
|
||||
case IEEE80211_FC0_TYPE_CTL:
|
||||
vap->iv_stats.is_rx_ctl++;
|
||||
@ -859,7 +856,7 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
ifp->if_ierrors++;
|
||||
out:
|
||||
if (m != NULL) {
|
||||
if (bpf_peers_present(vap->iv_rawbpf) && need_tap)
|
||||
if (need_tap && bpf_peers_present(vap->iv_rawbpf))
|
||||
bpf_mtap(vap->iv_rawbpf, m);
|
||||
m_freem(m);
|
||||
}
|
||||
|
@ -866,11 +866,8 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
wh = mtod(m, struct ieee80211_frame *);
|
||||
wh->i_fc[1] &= ~IEEE80211_FC1_WEP;
|
||||
}
|
||||
if (bpf_peers_present(vap->iv_rawbpf))
|
||||
bpf_mtap(vap->iv_rawbpf, m);
|
||||
vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp);
|
||||
m_freem(m);
|
||||
return IEEE80211_FC0_TYPE_MGT;
|
||||
goto out;
|
||||
|
||||
case IEEE80211_FC0_TYPE_CTL:
|
||||
vap->iv_stats.is_rx_ctl++;
|
||||
@ -886,7 +883,7 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
ifp->if_ierrors++;
|
||||
out:
|
||||
if (m != NULL) {
|
||||
if (bpf_peers_present(vap->iv_rawbpf) && need_tap)
|
||||
if (need_tap && bpf_peers_present(vap->iv_rawbpf))
|
||||
bpf_mtap(vap->iv_rawbpf, m);
|
||||
m_freem(m);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user