From 47e9bda3136533996ae254ec54e07d051121aea7 Mon Sep 17 00:00:00 2001 From: Matthew Newton Date: Wed, 2 Aug 2023 12:11:53 +0100 Subject: [PATCH] Don't send global stats when asked for client stats They use the same attributes, which makes the result confusing For FreeRADIUS-Statistics-Type: 0x00 will send global stats and no more 0x10 sends internal queue stats, and may as well send global stats too 0x20 sends client stats but uses the same attrs as global so should not send global stats 0x40 sends server listen stats, same attrs so should not send global stats as above 0x80 sends proxy home-server stats; uses different attrs so could send global stats, but to be consistent with above still don't do so --- doc/ChangeLog | 2 ++ src/main/stats.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 41dafb2183..ec5d028525 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -17,6 +17,8 @@ FreeRADIUS 3.2.4 Fri 26 May 2023 12:00:00 EDT urgency=low canonical attribute * Make FreeRADIUS-Server-EMA* attributes work again for home server exponential moving average statistics. + * Don't send the global server stats when asked for client stats. They + use the same attributes, so the result is confusing. FreeRADIUS 3.2.3 Fri 26 May 2023 12:00:00 EDT urgency=low Configuration changes diff --git a/src/main/stats.c b/src/main/stats.c index 20ba24ce52..2f5298d384 100644 --- a/src/main/stats.c +++ b/src/main/stats.c @@ -526,7 +526,7 @@ void request_stats_reply(REQUEST *request) * Authentication. */ if (((flag->vp_integer & 0x01) != 0) && /* auth */ - ((flag->vp_integer & 0xc0) == 0)) { /* not server or home-server */ + ((flag->vp_integer & 0xe0) == 0)) { /* not client, server or home-server */ request_stats_addvp(request, authvp, &radius_auth_stats); } @@ -535,7 +535,7 @@ void request_stats_reply(REQUEST *request) * Accounting */ if (((flag->vp_integer & 0x02) != 0) && /* accounting */ - ((flag->vp_integer & 0xc0) == 0)) { /* not server or home-server */ + ((flag->vp_integer & 0xe0) == 0)) { /* not client, server or home-server */ request_stats_addvp(request, acctvp, &radius_acct_stats); } #endif -- 2.47.3