upcall: Avoid divide-by-zero calculating flow limit
authorJoe Stringer <joestringer@nicira.com>
Tue, 28 Jan 2014 21:04:35 +0000 (13:04 -0800)
committerEthan Jackson <ethan@nicira.com>
Wed, 29 Jan 2014 00:07:29 +0000 (16:07 -0800)
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto-dpif-upcall.c

index 24919db..ff979ba 100644 (file)
@@ -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;