summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/dm_coa.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-12-01 16:40:04 +0300
committerDmitry Kozlov <xeb@mail.ru>2014-12-01 16:40:04 +0300
commit574912df113888ea19b4811b406612544514d9eb (patch)
treea7fec6d150d8710b31d4730ef7fab5c4c9ce4417 /accel-pppd/radius/dm_coa.c
parent3cc7fd0165e096be25761710b66b44fda9d09190 (diff)
parente09279c7491a8bd16a25b123e03ddd0cd77b566d (diff)
downloadaccel-ppp-574912df113888ea19b4811b406612544514d9eb.tar.gz
accel-ppp-574912df113888ea19b4811b406612544514d9eb.zip
Merge branch 'master' of ssh://git.code.sf.net/p/accel-ppp/code
Diffstat (limited to 'accel-pppd/radius/dm_coa.c')
-rw-r--r--accel-pppd/radius/dm_coa.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/accel-pppd/radius/dm_coa.c b/accel-pppd/radius/dm_coa.c
index 0235ba4..fd59bf1 100644
--- a/accel-pppd/radius/dm_coa.c
+++ b/accel-pppd/radius/dm_coa.c
@@ -36,7 +36,7 @@ static int dm_coa_check_RA(struct rad_packet_t *pack, const char *secret)
MD5_CTX ctx;
memset(RA, 0, 16);
-
+
MD5_Init(&ctx);
MD5_Update(&ctx, pack->buf, 4);
MD5_Update(&ctx, RA, 16);
@@ -69,7 +69,7 @@ static int dm_coa_send_ack(int fd, struct rad_packet_t *req, struct sockaddr_in
return -1;
reply->id = req->id;
-
+
if (rad_packet_build(reply, RA)) {
rad_packet_free(reply);
return -1;
@@ -83,7 +83,7 @@ static int dm_coa_send_ack(int fd, struct rad_packet_t *req, struct sockaddr_in
}
rad_packet_send(reply, fd, addr);
-
+
rad_packet_free(reply);
return 0;
@@ -118,7 +118,7 @@ static int dm_coa_send_nak(int fd, struct rad_packet_t *req, struct sockaddr_in
}
rad_packet_send(reply, fd, addr);
-
+
rad_packet_free(reply);
return 0;
@@ -135,7 +135,7 @@ static void disconnect_request(struct radius_pd_t *rpd)
dm_coa_send_ack(serv.hnd.fd, rpd->dm_coa_req, &rpd->dm_coa_addr);
rad_packet_free(rpd->dm_coa_req);
-
+
pthread_mutex_lock(&rpd->lock);
rpd->dm_coa_req = NULL;
pthread_mutex_unlock(&rpd->lock);
@@ -183,7 +183,7 @@ static void coa_request(struct radius_pd_t *rpd)
dm_coa_send_ack(serv.hnd.fd, rpd->dm_coa_req, &rpd->dm_coa_addr);
}
-
+
rad_packet_free(rpd->dm_coa_req);
pthread_mutex_lock(&rpd->lock);
@@ -232,14 +232,14 @@ static int dm_coa_read(struct triton_md_handler_t *h)
err_code = 403;
goto out_err;
}
-
+
rpd = rad_find_session_pack(pack);
if (!rpd) {
log_warn("radius:dm_coa: session not found\n");
err_code = 503;
goto out_err;
}
-
+
if (rpd->dm_coa_req) {
pthread_mutex_unlock(&rpd->lock);
goto out_err_no_reply;
@@ -292,7 +292,7 @@ static void init(void)
log_emerg("radius:dm_coa: socket: %s\n", strerror(errno));
return;
}
-
+
fcntl(serv.hnd.fd, F_SETFD, fcntl(serv.hnd.fd, F_GETFD) | FD_CLOEXEC);
addr.sin_family = AF_INET;
@@ -312,7 +312,7 @@ static void init(void)
close(serv.hnd.fd);
return;
}
-
+
triton_context_register(&serv.ctx, NULL);
triton_md_register_handler(&serv.ctx, &serv.hnd);
triton_md_enable_handler(&serv.hnd, MD_MODE_READ);