Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2013 00:55:05 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r249784 - user/adrian/net80211_tx/sys/net80211
Message-ID:  <201304230055.r3N0t52F078316@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304230055.r3N0t52F078316>