From: Alan T. DeKok Date: Mon, 19 Dec 2016 21:33:59 +0000 (-0500) Subject: fix RTT calculation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35b025b49086e792c608bbdbdc14530bf4e34c14;p=thirdparty%2Ffreeradius-server.git fix RTT calculation --- diff --git a/src/util/channel.c b/src/util/channel.c index 1d5305ac9ba..bc286faf92a 100644 --- a/src/util/channel.c +++ b/src/util/channel.c @@ -238,7 +238,7 @@ static int fr_channel_data_ready(fr_channel_t *ch, fr_time_t when, fr_channel_en } #define IALPHA (8) -#define RTT(_old, _new) ((_old + ((IALPHA - 1) * _new)) / IALPHA) +#define RTT(_old, _new) ((_new + ((IALPHA - 1) * _old)) / IALPHA) /** Send a request message into the channel * diff --git a/src/util/time.c b/src/util/time.c index 25295ce58d6..81e4725225f 100644 --- a/src/util/time.c +++ b/src/util/time.c @@ -166,7 +166,7 @@ void fr_time_tracking_start(fr_time_tracking_t *tt, fr_time_t when) #define IALPHA (8) -#define RTT(_old, _new) ((_old + ((IALPHA - 1) * _new)) / IALPHA) +#define RTT(_old, _new) ((_new + ((IALPHA - 1) * _old)) / IALPHA) /** End time tracking for this request. *