svn commit: r203345 - user/luigi/ipfw3-head/sys/netinet/ipfw

Luigi Rizzo luigi at FreeBSD.org
Mon Feb 1 14:29:07 UTC 2010


Author: luigi
Date: Mon Feb  1 14:29:07 2010
New Revision: 203345
URL: http://svn.freebsd.org/changeset/base/203345

Log:
  fix removal of a queue from the round robin list

Modified:
  user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_rr.c

Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_rr.c
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_rr.c	Mon Feb  1 14:17:40 2010	(r203344)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_rr.c	Mon Feb  1 14:29:07 2010	(r203345)
@@ -113,15 +113,14 @@ remove_queue_q(struct rr_queue *q, struc
 	if (q == si->head)
 		return rr_remove_head(si);
 
-	prev = si->head;
-	while (prev) {
-		if (prev->qnext == q) {
-			prev->qnext = q->qnext;
-			if (q == si->tail)
-				si->tail = prev;
-			q->status = 0;
-		}
-		prev = prev->qnext;
+	for (prev = si->head; prev; prev = prev->qnext) {
+		if (prev->qnext != q)
+			continue;
+		prev->qnext = q->qnext;
+		if (q == si->tail)
+			si->tail = prev;
+		q->status = 0;
+		break;
 	}
 }
 


More information about the svn-src-user mailing list