Handle ps-poll data frame if_transmit() failure.
If the data frame transmission failures, it may have a node reference that needs cleaning up. If the frame is marked as M_ENCAP then it should treat recvif as a node reference and clear it. Now - since the mbuf has been freed by calling if_transmit() (even on failure), the mbuf has to be treated as invalid. Hence why the ifp is used.
This commit is contained in:
parent
17b08c4368
commit
7ea3aada55
@ -2324,5 +2324,19 @@ ieee80211_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m0)
|
||||
ifp = vap->iv_ic->ic_ifp;
|
||||
else
|
||||
ifp = vap->iv_ifp;
|
||||
(void) ifp->if_transmit(ifp, m);
|
||||
|
||||
/*
|
||||
* Free any node ref which this mbuf may have.
|
||||
*
|
||||
* Much like psq_mfree(), we assume that M_ENCAP nodes have
|
||||
* node references.
|
||||
*/
|
||||
if (ifp->if_transmit(ifp, m) != 0) {
|
||||
/*
|
||||
* XXX m is invalid (freed) at this point, determine M_ENCAP
|
||||
* an alternate way.
|
||||
*/
|
||||
if (ifp == vap->iv_ic->ic_ifp)
|
||||
ieee80211_free_node(ni);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user