]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't send global stats when asked for client stats
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 2 Aug 2023 11:11:53 +0000 (12:11 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 2 Aug 2023 12:13:09 +0000 (13:13 +0100)
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
src/main/stats.c

index 41dafb2183c5b5cb288fec495e0ff9744f6575aa..ec5d0285255489fde04723ba105cd113cd0857c5 100644 (file)
@@ -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
index 20ba24ce5214e7135209940beba22acea0bb1d8d..2f5298d384847a3eab9c928581b7fccb95e2dcbc 100644 (file)
@@ -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