radrelay patch for 1.1.6

Milan Holub holub at thenet.ch
Thu May 17 16:41:45 CEST 2007


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
--------------------------------------



More information about the Freeradius-Users mailing list