summaryrefslogtreecommitdiff
path: root/accel-pppd/extra
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/extra')
-rw-r--r--accel-pppd/extra/connlimit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/accel-pppd/extra/connlimit.c b/accel-pppd/extra/connlimit.c
index 56a0895..243634e 100644
--- a/accel-pppd/extra/connlimit.c
+++ b/accel-pppd/extra/connlimit.c
@@ -45,6 +45,11 @@ int __export connlimit_check(uint64_t key)
d = (ts.tv_sec - it->ts.tv_sec) * 1000 + (ts.tv_nsec - it->ts.tv_nsec) / 1000000;
if (it->key == key) {
+ if (d >= conf_burst_timeout) {
+ it->ts = ts;
+ list_move(&it->entry, &items);
+ it->count = 0;
+ }
it->count++;
if (it->count >= conf_burst) {
if (d >= conf_limit_timeout) {
@@ -53,13 +58,8 @@ int __export connlimit_check(uint64_t key)
r = 0;
} else
r = -1;
- } else {
- if (d >= conf_burst_timeout) {
- it->ts = ts;
- list_move(&it->entry, &items);
- }
+ } else
r = 0;
- }
break;
}