From: Joe Stringer Date: Tue, 28 Jan 2014 21:04:35 +0000 (-0800) Subject: upcall: Avoid divide-by-zero calculating flow limit X-Git-Tag: sliver-openvswitch-2.1.90-1~8^2~28 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=08d74a962e302b752f53a9c367053a39068104ed upcall: Avoid divide-by-zero calculating flow limit Signed-off-by: Joe Stringer Acked-by: Ethan Jackson --- diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 24919db3c..ff979ba16 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;