svn commit: r195292 - projects/mesh11s/sys/net80211
Sam Leffler
sam at FreeBSD.org
Thu Jul 2 16:41:10 UTC 2009
Author: sam
Date: Thu Jul 2 16:41:09 2009
New Revision: 195292
URL: http://svn.freebsd.org/changeset/base/195292
Log:
o fix age on removal
o correct comments
Modified:
projects/mesh11s/sys/net80211/ieee80211_ageq.c
Modified: projects/mesh11s/sys/net80211/ieee80211_ageq.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_ageq.c Thu Jul 2 16:33:38 2009 (r195291)
+++ projects/mesh11s/sys/net80211/ieee80211_ageq.c Thu Jul 2 16:41:09 2009 (r195292)
@@ -151,10 +151,10 @@ ieee80211_ageq_drain_node(struct ieee802
/*
* Age frames on the age queue. Ages are stored as time
- * deltas (in seconds) so we can check and/or adjust only
- * the head of the list. If a frame's age exceeds the time
- * quanta then remove it. The list of removed frames is
- * is returned to the caller joined by m_nextpkt.
+ * deltas (in seconds) relative to the head so we can check
+ * and/or adjust only the head of the list. If a frame's age
+ * exceeds the time quanta then remove it. The list of removed
+ * frames is is returned to the caller joined by m_nextpkt.
*/
struct mbuf *
ieee80211_ageq_age(struct ieee80211_ageq *aq, int quanta)
@@ -183,17 +183,19 @@ ieee80211_ageq_age(struct ieee80211_ageq
}
/*
- * Remove all frames matching the specified node identifier.
- * Frames are returned as a list joined by m_nextpkt.
+ * Remove all frames matching the specified node identifier
+ * (NULL matches all). Frames are returned as a list joined
+ * by m_nextpkt.
*/
struct mbuf *
ieee80211_ageq_remove(struct ieee80211_ageq *aq,
struct ieee80211_node *match)
{
- struct mbuf *m, **prev;
+ struct mbuf *m, **prev, *ohead;
struct mbuf *head, **phead;
IEEE80211_AGEQ_LOCK(aq);
+ ohead = aq->aq_head;
prev = &aq->aq_head;
phead = &head;
while ((m = *prev) != NULL) {
@@ -225,7 +227,8 @@ ieee80211_ageq_remove(struct ieee80211_a
*phead = m;
phead = &m->m_nextpkt;
}
- /* XXX fix age */
+ if (head == ohead && aq->aq_head != NULL) /* correct age */
+ M_AGE_SET(aq->aq_head, M_AGE_GET(head));
IEEE80211_AGEQ_UNLOCK(aq);
*phead = NULL;
More information about the svn-src-projects
mailing list