summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_hostap.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-01-06 04:40:07 +0000
committeradrian <adrian@FreeBSD.org>2013-01-06 04:40:07 +0000
commitcb53fcbe56790374d8b6cf61cd4054267f71231d (patch)
treec6da2c237a71ea4ecfcd3d4643eeacbc63da87af /sys/net80211/ieee80211_hostap.c
parentdf2147e23ee2579975174b7eebcc404798ba2168 (diff)
downloadFreeBSD-src-cb53fcbe56790374d8b6cf61cd4054267f71231d.zip
FreeBSD-src-cb53fcbe56790374d8b6cf61cd4054267f71231d.tar.gz
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.
Diffstat (limited to 'sys/net80211/ieee80211_hostap.c')
-rw-r--r--sys/net80211/ieee80211_hostap.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c
index 675f3da..7087748 100644
--- a/sys/net80211/ieee80211_hostap.c
+++ b/sys/net80211/ieee80211_hostap.c
@@ -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);
+ }
}
OpenPOWER on IntegriCloud