summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/req.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-10-04 18:52:17 +0400
committerDmitry Kozlov <xeb@mail.ru>2014-10-04 18:52:17 +0400
commit43a444fc65d917bf680831c0b942d682d933dc84 (patch)
treecc7c85b61e86f72795e4c3881199e3a96ddd0ca6 /accel-pppd/radius/req.c
parentcc301ec08bf329968cea8fab8a5d7c4b05a1870b (diff)
downloadaccel-ppp-43a444fc65d917bf680831c0b942d682d933dc84.tar.gz
accel-ppp-43a444fc65d917bf680831c0b942d682d933dc84.zip
radius: various bug fixes
Diffstat (limited to 'accel-pppd/radius/req.c')
-rw-r--r--accel-pppd/radius/req.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index 94754a26..0382e165 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -231,6 +231,7 @@ int rad_req_acct_fill(struct rad_req_t *req)
void rad_req_free(struct rad_req_t *req)
{
assert(!req->active);
+ assert(!req->entry.next);
if (req->serv)
rad_server_put(req->serv, req->type);
@@ -386,6 +387,9 @@ int rad_req_read(struct triton_md_handler_t *h)
struct rad_req_t *req = container_of(h, typeof(*req), hnd);
struct rad_packet_t *pack;
+ if (!req->rpd)
+ log_switch(triton_context_self(), NULL);
+
while (1) {
if (rad_packet_recv(h->fd, &pack, NULL))
return 0;
@@ -400,6 +404,8 @@ int rad_req_read(struct triton_md_handler_t *h)
if (req->active)
rad_server_req_exit(req);
+ else
+ rad_server_req_cancel(req, 0);
if (req->log) {
req->log("recv ");