[ovs-dev] [PATCH] upcall: Avoid divide-by-zero calculating flow limit
Joe Stringer
joestringer at nicira.com
Tue Jan 28 21:04:35 UTC 2014
Signed-off-by: Joe Stringer <joestringer at nicira.com>
---
ofproto/ofproto-dpif-upcall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 24919db..ff979ba 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -615,7 +615,7 @@ udpif_flow_dumper(void *arg)
ovs_mutex_unlock(&revalidator->mutex);
}
- duration = time_msec() - start_time;
+ duration = MAX(time_msec() - start_time, 1);
udpif->dump_duration = duration;
if (duration > 2000) {
flow_limit /= duration / 1000;
--
1.7.9.5
More information about the dev
mailing list