Patch for accounting in TCP mode

Natarajan M natarajan.m at gmail.com
Thu May 4 16:41:57 UTC 2023


Accounting requests are ignored when TCP connection mode is used. Following
fix fixes the issue, is it possible to take this to one of the releases?

diff --git a/src/main/listen.c b/src/main/listen.c

index 19d22a24fd..0bd88cdde0 100644

--- a/src/main/listen.c

+++ b/src/main/listen.c

@@ -575,7 +575,16 @@ static int dual_tcp_recv(rad_listen_t *listener)



 #ifdef WITH_ACCOUNTING

  case PW_CODE_ACCOUNTING_REQUEST:

- if (listener->type != RAD_LISTEN_ACCT) goto bad_packet;

+ if (listener->type != RAD_LISTEN_ACCT) {

+ /*

+ * Allow auth + dual.  Disallow

+ * everything else.

+ */

+ if (!((listener->type == RAD_LISTEN_AUTH) &&

+       (listener->dual))) {

+     goto bad_packet;

+ }

+ }

  FR_STATS_INC(acct, total_requests);

  fun = rad_accounting;

  break;

Thanks
Natarajan


More information about the Freeradius-Devel mailing list