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:
Adrian Chadd 2013-01-06 04:40:07 +00:00
parent 17b08c4368
commit 7ea3aada55
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245098

View File

@ -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);
}
}