summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-09-22 13:12:36 +0400
committerDmitry Kozlov <xeb@mail.ru>2014-09-22 13:12:36 +0400
commitfb1f7723afe46d696ba62597909066fea42bfaec (patch)
treec8558ba2abe0899173b85d6724eadcbbb24c0b71
parent62e89248160d3592c2d754fcaa15e37586a5b091 (diff)
downloadaccel-ppp-fb1f7723afe46d696ba62597909066fea42bfaec.tar.gz
accel-ppp-fb1f7723afe46d696ba62597909066fea42bfaec.zip
fixed compilation warnings
-rw-r--r--accel-pppd/auth/auth_pap.c2
-rw-r--r--accel-pppd/radius/radius_p.h2
-rw-r--r--accel-pppd/radius/req.c3
-rw-r--r--accel-pppd/radius/serv.c8
-rw-r--r--accel-pppd/shaper/leaf_qdisc.c3
-rw-r--r--accel-pppd/triton/mempool.c2
6 files changed, 13 insertions, 7 deletions
diff --git a/accel-pppd/auth/auth_pap.c b/accel-pppd/auth/auth_pap.c
index 9aab377..909b115 100644
--- a/accel-pppd/auth/auth_pap.c
+++ b/accel-pppd/auth/auth_pap.c
@@ -312,7 +312,7 @@ static void pap_recv(struct ppp_handler_t *h)
struct pap_auth_data *d = container_of(h, typeof(*d), h);
struct pap_hdr *hdr = (struct pap_hdr *)d->ppp->buf;
- if (d->ppp->buf_size < sizeof(*hdr) || ntohs(hdr->len) < HDR_LEN || ntohs(hdr->len) < d->ppp->buf_size - 2) {
+ if (d->ppp->buf_size < sizeof(*hdr) || ntohs(hdr->len) < HDR_LEN || ntohs(hdr->len) > d->ppp->buf_size - 2) {
log_ppp_warn("PAP: short packet received\n");
return;
}
diff --git a/accel-pppd/radius/radius_p.h b/accel-pppd/radius/radius_p.h
index cfb92cd..22124a2 100644
--- a/accel-pppd/radius/radius_p.h
+++ b/accel-pppd/radius/radius_p.h
@@ -73,7 +73,7 @@ struct rad_req_t {
in_addr_t server_addr;
- int server_port:16;
+ int server_port;
int type:8;
int try:6;
int active:1;
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index 172fb1c..94754a2 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -398,7 +398,8 @@ int rad_req_read(struct triton_md_handler_t *h)
req->reply = pack;
- rad_server_req_exit(req);
+ if (req->active)
+ rad_server_req_exit(req);
if (req->log) {
req->log("recv ");
diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c
index 6c01a88..2f69c66 100644
--- a/accel-pppd/radius/serv.c
+++ b/accel-pppd/radius/serv.c
@@ -134,7 +134,8 @@ int rad_server_req_cancel(struct rad_req_t *req)
}
pthread_mutex_unlock(&req->serv->lock);
- rad_server_req_exit(req);
+ if (req->active)
+ rad_server_req_exit(req);
if (req->timeout.tpd)
triton_timer_del(&req->timeout);
@@ -186,7 +187,10 @@ int rad_server_req_enter(struct rad_req_t *req)
pthread_mutex_unlock(&req->serv->lock);
req->active = 1;
-
+
+ if (req->send)
+ return req->send(req, 0);
+
return 0;
}
diff --git a/accel-pppd/shaper/leaf_qdisc.c b/accel-pppd/shaper/leaf_qdisc.c
index 6c90968..cdc9eed 100644
--- a/accel-pppd/shaper/leaf_qdisc.c
+++ b/accel-pppd/shaper/leaf_qdisc.c
@@ -56,6 +56,7 @@ static int parse_size(const char *str, int *r)
return 0;
}
+#ifdef TCA_FQ_CODEL_MAX
static int parse_time(const char *str, int *r)
{
double t;
@@ -82,7 +83,7 @@ static int parse_time(const char *str, int *r)
return 0;
}
-
+#endif
static int parse_int(const char *str, int *r)
{
diff --git a/accel-pppd/triton/mempool.c b/accel-pppd/triton/mempool.c
index 7e5a4ce..7c8c56c 100644
--- a/accel-pppd/triton/mempool.c
+++ b/accel-pppd/triton/mempool.c
@@ -15,7 +15,7 @@
#define DELAY 5
#endif
-#define MEMPOOL_DISABLE
+//#define MEMPOOL_DISABLE
#define MAGIC1 0x2233445566778899llu
#define PAGE_ORDER 5