]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix float point exception in radmin
authorJorge Pereira <jpereiran@gmail.com>
Tue, 24 Dec 2019 19:56:56 +0000 (16:56 -0300)
committerAlan DeKok <aland@freeradius.org>
Wed, 25 Dec 2019 15:48:35 +0000 (10:48 -0500)
src/lib/io/worker.c

index 159067fc678f44a75fe88408ffe53d7b99c15420..2c7dd39504e891e16b5aee788123be548de99385 100644 (file)
@@ -1372,7 +1372,7 @@ static int cmd_stats_worker(FILE *fp, UNUSED FILE *fp_err, void *ctx, fr_cmd_inf
                fprintf(fp, "cpu.request_time_rtt\t\t%u.%09" PRIu64 "\n", (unsigned int) (when / NSEC), when % NSEC);
 
                when = worker->tracking.running_total;
-               when /= (worker->stats.in - worker->stats.dropped);
+               if (when > 0) when /= (worker->stats.in - worker->stats.dropped);
                fprintf(fp, "cpu.average_request_time\t%u.%09" PRIu64 "\n", (unsigned int) (when / NSEC), when % NSEC);
 
                when = worker->tracking.running_total;