diff options
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/accel-ppp.conf.5 | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/pppoe/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/sstp/sstp.c | 12 | ||||
-rw-r--r-- | accel-pppd/shaper/limiter.c | 6 |
4 files changed, 15 insertions, 7 deletions
diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5 index 1c7fb9fd..72376c35 100644 --- a/accel-pppd/accel-ppp.conf.5 +++ b/accel-pppd/accel-ppp.conf.5 @@ -1243,7 +1243,7 @@ Specifes upstream rate limiting method. Specifies downstream rate limiting method. \fIclsact\fR is a policer .TP .BI "leaf-qdisc=" "qdisc parameters" -In case if htb is used as up-limiter or down-limiter specified leaf qdisc can be attached automatically. +In case if tbf is used as down-limiter or htb is used as up-limiter or down-limiter specified leaf qdisc can be attached automatically. At present sfq and fq_codel qdiscs are implemented. Parameters are same as for tc: .br sfq [ limit NUMBER ] [ perturn SECS ] [ quantum BYTES ] diff --git a/accel-pppd/ctrl/pppoe/CMakeLists.txt b/accel-pppd/ctrl/pppoe/CMakeLists.txt index 808cd513..fd4f9a36 100644 --- a/accel-pppd/ctrl/pppoe/CMakeLists.txt +++ b/accel-pppd/ctrl/pppoe/CMakeLists.txt @@ -13,7 +13,7 @@ SET(sources ${sources} tr101.c) ENDIF(RADIUS) ADD_LIBRARY(pppoe SHARED ${sources}) -TARGET_LINK_LIBRARIES(pppoe vlan-mon) +TARGET_LINK_LIBRARIES(pppoe vlan-mon connlimit) set_property(TARGET pppoe PROPERTY CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set_property(TARGET pppoe PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/accel-ppp) diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c index 2e2c4d3b..2a9ddae3 100644 --- a/accel-pppd/ctrl/sstp/sstp.c +++ b/accel-pppd/ctrl/sstp/sstp.c @@ -187,6 +187,7 @@ static unsigned int stat_active; static inline void sstp_queue(struct sstp_conn_t *conn, struct buffer_t *buf); static int sstp_send(struct sstp_conn_t *conn, struct buffer_t *buf); static inline void sstp_queue_deferred(struct sstp_conn_t *conn, struct buffer_t *buf); +static int sstp_write(struct triton_md_handler_t *h); static int sstp_read_deferred(struct sstp_conn_t *conn); static int sstp_abort(struct sstp_conn_t *conn, int disconnect); static void sstp_disconnect(struct sstp_conn_t *conn); @@ -858,7 +859,7 @@ static int http_send_response(struct sstp_conn_t *conn, char *proto, char *statu } } - return sstp_send(conn, buf); + return sstp_send(conn, buf) || sstp_write(&conn->hnd); } static int http_recv_request(struct sstp_conn_t *conn, uint8_t *data, int len) @@ -937,7 +938,7 @@ static int http_handler(struct sstp_conn_t *conn, struct buffer_t *buf) static const char *table[] = { "\n\r\n", "\r\r\n", NULL }; const char **pptr; uint8_t *ptr, *end = NULL; - int n; + int n, r; if (conn->sstp_state != STATE_SERVER_CALL_DISCONNECTED) return -1; @@ -963,8 +964,11 @@ static int http_handler(struct sstp_conn_t *conn, struct buffer_t *buf) } else n = end - buf->head; - if (http_recv_request(conn, buf->head, n) < 0) + r = http_recv_request(conn, buf->head, n); + if (r < 0) return -1; + else if (r > 0) + return 1; buf_pull(buf, n); conn->sstp_state = STATE_SERVER_CONNECT_REQUEST_PENDING; @@ -1950,6 +1954,8 @@ static int sstp_read(struct triton_md_handler_t *h) n = conn->handler(conn, buf); if (n < 0) goto drop; + else if (n > 0) + return 1; buf_expand_tail(buf, SSTP_MAX_PACKET_SIZE); } diff --git a/accel-pppd/shaper/limiter.c b/accel-pppd/shaper/limiter.c index 5527a12c..e3e27cbd 100644 --- a/accel-pppd/shaper/limiter.c +++ b/accel-pppd/shaper/limiter.c @@ -552,9 +552,11 @@ int install_limiter(struct ap_session *ses, int down_speed, int down_burst, int down_speed = down_speed * 1000 / 8; down_burst = down_burst ? down_burst : conf_down_burst_factor * down_speed; - if (conf_down_limiter == LIM_TBF) + if (conf_down_limiter == LIM_TBF) { r = install_tbf(rth, ses->ifindex, down_speed, down_burst); - else if (conf_down_limiter == LIM_CLSACT) + if (r == 0) + r = install_leaf_qdisc(rth, ses->ifindex, 0x00010000, 0x00020000); + } else if (conf_down_limiter == LIM_CLSACT) r = install_clsact(rth, ses->ifindex, down_speed, down_burst); else { r = install_htb(rth, ses->ifindex, down_speed, down_burst); |