summaryrefslogtreecommitdiff
path: root/accel-pptpd/ppp
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2010-12-20 15:29:01 +0300
committerDmitry Kozlov <xeb@mail.ru>2010-12-20 15:29:01 +0300
commit24533babd9fe766461ac346d8fc879f3fe4bc60b (patch)
treefb4e16806bb6e0bea65f877e62c379cd347064bb /accel-pptpd/ppp
parente4e7cdf5eba8d68ffe620056517d15fef21074cf (diff)
downloadaccel-ppp-24533babd9fe766461ac346d8fc879f3fe4bc60b.tar.gz
accel-ppp-24533babd9fe766461ac346d8fc879f3fe4bc60b.zip
ppp: drop connection when read from ppp channel/unit descriptor returns zero
Diffstat (limited to 'accel-pptpd/ppp')
-rw-r--r--accel-pptpd/ppp/ppp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/accel-pptpd/ppp/ppp.c b/accel-pptpd/ppp/ppp.c
index 84c05eb..79c90a3 100644
--- a/accel-pptpd/ppp/ppp.c
+++ b/accel-pptpd/ppp/ppp.c
@@ -290,6 +290,10 @@ cont:
//printf("ppp_chan_read: ");
//print_buf(ppp->chan_buf,ppp->chan_buf_size);
+ if (ppp->chan_buf_size == 0) {
+ ppp_terminate(ppp, 1, TERM_NAS_ERROR);
+ return 1;
+ }
if (ppp->chan_buf_size < 2) {
log_ppp_error("ppp_chan_read: short read %i\n", ppp->chan_buf_size);
@@ -325,7 +329,7 @@ cont:
if (ppp->unit_buf_size < 0) {
if (errno == EAGAIN)
return 0;
- log_ppp_error("ppp_chan_read: %s\n",strerror(errno));
+ log_ppp_error("ppp_unit_read: %s\n",strerror(errno));
return 0;
}
@@ -333,8 +337,13 @@ cont:
//printf("ppp_unit_read: ");
//print_buf(ppp->unit_buf,ppp->unit_buf_size);
+ if (ppp->unit_buf_size == 0) {
+ ppp_terminate(ppp, 1, TERM_NAS_ERROR);
+ return 1;
+ }
+
if (ppp->unit_buf_size < 2) {
- log_ppp_error("ppp_chan_read: short read %i\n", ppp->unit_buf_size);
+ log_ppp_error("ppp_unit_read: short read %i\n", ppp->unit_buf_size);
continue;
}