svn commit: r249784 - user/adrian/net80211_tx/sys/net80211

Adrian Chadd adrian at FreeBSD.org
Tue Apr 23 00:55:05 UTC 2013


Author: adrian
Date: Tue Apr 23 00:55:04 2013
New Revision: 249784
URL: http://svnweb.freebsd.org/changeset/base/249784

Log:
  For now, make sure this doesn't panic.   i'll figure out this bug later.

Modified:
  user/adrian/net80211_tx/sys/net80211/ieee80211_power.c

Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_power.c
==============================================================================
--- user/adrian/net80211_tx/sys/net80211/ieee80211_power.c	Tue Apr 23 00:10:33 2013	(r249783)
+++ user/adrian/net80211_tx/sys/net80211/ieee80211_power.c	Tue Apr 23 00:55:04 2013	(r249784)
@@ -386,6 +386,19 @@ ieee80211_pwrsave(struct ieee80211_node 
 		qhead->tail->m_nextpkt = m;
 		age -= M_AGE_GET(qhead->head);
 	}
+
+	/*
+	 * There's an odd bug where age ends up being -ve;
+	 * the age calculation above returns '0' but the frame
+	 * on the queue head has an age of 1. So, clamp a negative
+	 * age to 0 here and figure this bug out later.
+	 *
+	 * The calc above returns 0 because the ni->ni_intval is 1,
+	 * so the calculation always returns 0.
+	 */
+	if (age < 0) {
+		age = 0;
+	}
 	KASSERT(age >= 0, ("age %d", age));
 	M_AGE_SET(m, age);
 	m->m_nextpkt = NULL;


More information about the svn-src-user mailing list