You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In module counter.conf, when a counter has a "weekly" reset, the calculation of the Prev Reset is wrong. In fact the Prev computed on 8 May 2016 is 2016-05-01 00:00:00. The Next Reset is ok (15 May 2016). This means that the period spans over 2 weeks instead of 1.
I have very little time, so, I'm sorry but I think I can't be super helpful. However, the fix should be easy:
The source code is at http://doc.freeradius.org/rlm__sqlcounter_8c_source.html
and to fix it, just change line 214 to:
tm->tm_mday -= tm->tm_wday +(7*(num-1));
This will set the prev to the nearest sunday before today.
dipixx
changed the title
Calculation of Prev reset is wrong on sundays
Calculation of Prev reset is wrong for reset = weekly
May 10, 2016
Issue type
See here for debugging instructions.
Defect/Feature description
In module counter.conf, when a counter has a "weekly" reset, the calculation of the Prev Reset is wrong. In fact the Prev computed on 8 May 2016 is 2016-05-01 00:00:00. The Next Reset is ok (15 May 2016). This means that the period spans over 2 weeks instead of 1.
How to reproduce issue
1- edit counter.conf and add this:
2- call this counter in the authorize section of the sites-available/default file
3- start freeradius -X
Output of
[radiusd|freeradius] -X
showing issue ocurringThe text was updated successfully, but these errors were encountered: