[trickle] Fix endless loop in bwstat_delay (#738729)

Nicoleau Fabien eponyme at fedoraproject.org
Mon Sep 19 19:11:23 UTC 2011


commit 57fd1a000ebea342eb5984d7232ae3604e735592
Author: eponyme <eponyme at fedoraproject.org>
Date:   Mon Sep 19 21:13:47 2011 +0200

    Fix endless loop in bwstat_delay (#738729)

 ...le-1.07-bwsta_getdelay-stop-if-no-packets.patch |   24 ++++++++++++++++++++
 trickle.spec                                       |    6 ++++-
 2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/trickle-1.07-bwsta_getdelay-stop-if-no-packets.patch b/trickle-1.07-bwsta_getdelay-stop-if-no-packets.patch
new file mode 100644
index 0000000..5ff6eda
--- /dev/null
+++ b/trickle-1.07-bwsta_getdelay-stop-if-no-packets.patch
@@ -0,0 +1,24 @@
+From 3b22c327ff6ac3ee51332919e91ae63d47225a9b Mon Sep 17 00:00:00 2001
+From: Alon Levy <alevy at redhat.com>
+Date: Thu, 15 Sep 2011 18:05:13 +0300
+Subject: [PATCH] bwsta_getdelay: stop if no packets
+
+---
+ bwstat.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/bwstat.c b/bwstat.c
+index a1c1085..9567275 100644
+--- a/bwstat.c
++++ b/bwstat.c
+@@ -210,7 +210,7 @@ bwstat_getdelay(struct bwstat *bs, size_t *len, uint lim, short which)
+ 
+ 			ent += xent;
+ 		}
+-	} while (pool > 0 && ncli > 0);
++	} while (pool > 0 && ncli > 0 && (TAILQ_FIRST(&poolq) != TAILQ_END(&poolq)));
+ 
+ 	/*
+ 	 * This is the case of a client that is not using its limit.
+-- 
+1.7.6.2
diff --git a/trickle.spec b/trickle.spec
index 1e883aa..530b9f1 100644
--- a/trickle.spec
+++ b/trickle.spec
@@ -1,6 +1,6 @@
 Name:           trickle
 Version:        1.07 
-Release:        11%{?dist}
+Release:        12%{?dist}
 Summary:        Portable lightweight userspace bandwidth shaper
 
 Group:          Applications/System
@@ -15,6 +15,7 @@ BuildRequires:  libevent-devel
 Patch0:         %{name}-%{version}-include_netdb.patch
 Patch1:         %{name}-%{version}-libdir.patch
 Patch2:         %{name}-%{version}-CVE-2009-0415.patch
+Patch3:         %{name}-%{version}-bwsta_getdelay-stop-if-no-packets.patch
 
 %description
 trickle is a portable lightweight userspace bandwidth shaper.
@@ -33,6 +34,7 @@ trickle runs entirely in userspace and does not require root privileges.
 %patch0 -p1 -b .include_netdb
 %patch1 -p1 -b .libdir
 %patch2 -p1 -b .cve
+%patch3 -p1
 touch -r configure aclocal.m4 Makefile.in stamp-h.in
 
 iconv -f ISO88591 -t UTF8 < README > README.UTF8
@@ -71,6 +73,8 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Thu Sep 15 2011 Alon Levy <alevy at redhat.com> 1.07-12
+- Fix endless loop in bwstat_delay (seen with spicec)
 * Sun Feb 13 2011 Nicoleau Fabien <nicoleau.fabien at gmail.com> 1.07-11
 - Revert to the working patch
 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.07-10


More information about the scm-commits mailing list