summaryrefslogtreecommitdiff
path: root/accel-pptpd/extra
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2011-01-05 02:41:19 +0300
committerDmitry Kozlov <xeb@mail.ru>2011-01-05 02:41:19 +0300
commit2fdf3586c13a72c36f9530084962e29d57dc0329 (patch)
tree599a21f10fba92c7b01f7562584e0bcd31ef322b /accel-pptpd/extra
parent2a05ce54544185f34016b1a9e46afda9d0af980e (diff)
downloadaccel-ppp-2fdf3586c13a72c36f9530084962e29d57dc0329.tar.gz
accel-ppp-2fdf3586c13a72c36f9530084962e29d57dc0329.zip
shaper_tbf: fix end-of-day overlapping ranges
Diffstat (limited to 'accel-pptpd/extra')
-rw-r--r--accel-pptpd/extra/shaper_tbf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/accel-pptpd/extra/shaper_tbf.c b/accel-pptpd/extra/shaper_tbf.c
index 99610dd..d7e4f0b 100644
--- a/accel-pptpd/extra/shaper_tbf.c
+++ b/accel-pptpd/extra/shaper_tbf.c
@@ -1101,8 +1101,13 @@ static void load_time_ranges(void)
r = parse_range(opt->val);
if (r) {
list_add_tail(&r->entry, &time_range_list);
- if (ts >= r->begin.expire_tv.tv_sec && ts <= r->end.expire_tv.tv_sec)
- time_range_begin_timer(&r->begin);
+ if (r->begin.expire_tv.tv_sec > r->end.expire_tv.tv_sec) {
+ if (ts >= r->begin.expire_tv.tv_sec - 24*60*60 && ts <= r->end.expire_tv.tv_sec)
+ time_range_begin_timer(&r->begin);
+ } else {
+ if (ts >= r->begin.expire_tv.tv_sec && ts <= r->end.expire_tv.tv_sec)
+ time_range_begin_timer(&r->begin);
+ }
if (r->begin.expire_tv.tv_sec < ts)
r->begin.expire_tv.tv_sec += 24 * 60 * 60;
if (r->end.expire_tv.tv_sec < ts)