From 0190cc37082c33c7bb51b0fb88266b0be70a801a Mon Sep 17 00:00:00 2001 From: Joe Stringer Date: Tue, 28 Jan 2014 13:04:35 -0800 Subject: [PATCH] upcall: Avoid divide-by-zero calculating flow limit Signed-off-by: Joe Stringer Acked-by: Ethan Jackson --- 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 aa39366bd..01793c765 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -596,7 +596,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; atomic_read(&udpif->flow_limit, &flow_limit); if (duration > 2000) { -- 2.20.1