diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2010-11-25 22:29:10 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2010-11-25 22:29:10 +0300 |
commit | 1cf19a1c76a8e13ee60a111fc6d64df3683cd3bc (patch) | |
tree | fa57c6d6417b59b74bcaab0631c757ef9602fc11 /accel-pptpd/triton | |
parent | 194b2c29a31aafc59fb0e0fac90411aae2fcd9aa (diff) | |
download | accel-ppp-1cf19a1c76a8e13ee60a111fc6d64df3683cd3bc.tar.gz accel-ppp-1cf19a1c76a8e13ee60a111fc6d64df3683cd3bc.zip |
radius: fixed bug of double packet free when second DM request received in time when radius sends Accounting-Request Stop
Diffstat (limited to 'accel-pptpd/triton')
-rw-r--r-- | accel-pptpd/triton/triton.c | 15 | ||||
-rw-r--r-- | accel-pptpd/triton/triton.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/accel-pptpd/triton/triton.c b/accel-pptpd/triton/triton.c index b62d04f1..a628fe16 100644 --- a/accel-pptpd/triton/triton.c +++ b/accel-pptpd/triton/triton.c @@ -416,6 +416,21 @@ int __export triton_context_call(struct triton_context_t *ud, void (*func)(void return 0; } +void __export triton_cancel_call(struct triton_context_t *ud, void (*func)(void *)) +{ + struct _triton_context_t *ctx = (struct _triton_context_t *)ud->tpd; + struct list_head *pos, *n; + struct _triton_ctx_call_t *call; + + list_for_each_safe(pos, n, &ctx->pending_calls) { + call = list_entry(pos, typeof(*call), entry); + if (call->func != func) + continue; + list_del(&call->entry); + mempool_free(call); + } +} + int __export triton_init(const char *conf_file) { ctx_pool = mempool_create2(sizeof(struct _triton_context_t)); diff --git a/accel-pptpd/triton/triton.h b/accel-pptpd/triton/triton.h index 94254288..0fd450cc 100644 --- a/accel-pptpd/triton/triton.h +++ b/accel-pptpd/triton/triton.h @@ -72,6 +72,7 @@ void triton_context_set_priority(struct triton_context_t *, int); void triton_context_schedule(struct triton_context_t *); int triton_context_wakeup(struct triton_context_t *); int triton_context_call(struct triton_context_t *, void (*func)(void *), void *arg); +void triton_cancel_call(struct triton_context_t *, void (*func)(void *)); #define MD_MODE_READ 1 #define MD_MODE_WRITE 2 |