Hi Alan, when using -R switch with radrelay binary from latest 1.1.6 release: `radrelay -f -R5 -d /etc/freeradius -a /var/log/freeradius/radacct/radrelay -S /etc/freeradius/radrelay_secret -r <remote_host> detail` I was continuously flooded by similar messages: ... radrelay: Running and Processing Records. Seconds since startup: <continuously increasing> Records Read: <continuously increasing> Packets Sent: 0 Record Rate since startup: <some rate> Packet Rate since startup: 0.00 ... There was an empty detail file (without any writer) thus I did not expected any records to be read... Here is my tested patch: Index: src/main/radrelay.c =================================================================== RCS file: /source/radiusd/src/main/Attic/radrelay.c,v retrieving revision 1.22.2.3.2.4 diff -u -r1.22.2.3.2.4 radrelay.c --- src/main/radrelay.c 16 Mar 2007 13:22:03 -0000 1.22.2.3.2.4 +++ src/main/radrelay.c 17 May 2007 14:27:35 -0000 @@ -678,9 +678,11 @@ rad_unlockfd(fileno(fp), 0); fseek(fp, fpos, SEEK_SET); } while(0); - if (r_args->records_print && state == STATE_RUN){ + else { stats.records_read++; - if (stats.last_print_records - stats.records_read >= r_args->records_print){ + } + if (r_args->records_print && state == STATE_RUN){ + if (stats.records_read != stats.last_print_records && (stats.records_read - stats.last_print_records) % r_args->records_print == 0){ now = time(NULL); uptime = (stats.startup == now) ? 1 : now - stats.startup; fprintf(stderr, "%s: Running and Processing Records.\n",progname); I believe it should be fixed in 1.X... Milan Holub holub (at) thenet (dot) ch -------------------------------------- TheNet-Internet Services AG, im Bernertechnopark, Morgenstr. 129 CH-3018, Bern, Switzerland 031 998 4333, Fax 031 998 4330 http://www.thenet.ch http://wlan.thenet.ch --------------------------------------
Milan Holub wrote:
Here is my tested patch:
Are you sure? ...
} while(0); - if (r_args->records_print && state == STATE_RUN){ + else { stats.records_read++;
... The "after" portion doesn't look like valid C to me. I'll check in a few days when I have access to a test machine. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
Hi Alan, On Thu, May 17, 2007 at 05:56:06PM +0200, Alan DeKok wrote:
Milan Holub wrote:
Here is my tested patch:
Are you sure?
...
} while(0); - if (r_args->records_print && state == STATE_RUN){ + else { stats.records_read++;
...
The "after" portion doesn't look like valid C to me. I'll check in a few days when I have access to a test machine.
==> you mean that else? -> it's related to: if (read_one(fp, r) == EOF) do {...} while (0); else ... ==> it compiles cleanly and works for me... Milan Holub holub (at) thenet (dot) ch -------------------------------------- TheNet-Internet Services AG, im Bernertechnopark, Morgenstr. 129 CH-3018, Bern, Switzerland 031 998 4333, Fax 031 998 4330 http://www.thenet.ch http://wlan.thenet.ch --------------------------------------
participants (2)
-
Alan DeKok -
Milan Holub