diff options
author | xebd <xeb@mail.ru> | 2017-12-05 16:48:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-05 16:48:19 +0300 |
commit | 00b8ac572ad265e912b5279f1fb98dbe463e2f40 (patch) | |
tree | bca3965242ba8d684992eafb564139ef22568b3c /accel-pppd | |
parent | f740a48aa7559c535329f8be137c35f319f811b8 (diff) | |
parent | f0829a7a37b991f0e7289e3c8d0140fcf72f9263 (diff) | |
download | accel-ppp-xebd-00b8ac572ad265e912b5279f1fb98dbe463e2f40.tar.gz accel-ppp-xebd-00b8ac572ad265e912b5279f1fb98dbe463e2f40.zip |
Merge pull request #23 from themiron/echo-fixes
pptp/l2tp: echo failure improvements
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 3 | ||||
-rw-r--r-- | accel-pppd/ctrl/pptp/pptp.c | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 51f8e7d..a44d31d 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -3213,6 +3213,9 @@ static int l2tp_recv_HELLO(struct l2tp_conn_t *conn, log_tunnel(log_debug, conn, "handling HELLO\n"); + if (conn->hello_timer.tpd) + triton_timer_mod(&conn->hello_timer, 0); + return 0; } diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index 99958cc..fa48687 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -413,6 +413,9 @@ static int pptp_echo_rqst(struct pptp_conn_t *conn) log_ppp_debug("send [PPTP Echo-Reply <Identifier %x>]\n", out_msg.identifier); } + if (conn->echo_timer.tpd) + triton_timer_mod(&conn->echo_timer, 0); + return post_msg(conn, &out_msg, sizeof(out_msg)); } @@ -423,13 +426,10 @@ static int pptp_echo_rply(struct pptp_conn_t *conn) if (conf_verbose) log_ppp_debug("recv [PPTP Echo-Reply <Identifier %x>]\n", msg->identifier); - /*if (msg->identifier != conn->echo_sent) { - log_ppp_warn("pptp:echo: identifier mismatch\n"); - //return -1; - }*/ conn->echo_sent = 0; return 0; } + static void pptp_send_echo(struct triton_timer_t *t) { struct pptp_conn_t *conn = container_of(t, typeof(*conn), echo_timer); @@ -443,8 +443,7 @@ static void pptp_send_echo(struct triton_timer_t *t) return; } - conn->echo_sent = random(); - msg.identifier = conn->echo_sent; + msg.identifier = random(); if (conf_verbose) log_ppp_debug("send [PPTP Echo-Request <Identifier %x>]\n", msg.identifier); @@ -761,7 +760,7 @@ static void load_config(void) conf_echo_interval = atoi(opt); opt = conf_get_opt("pptp", "echo-failure"); - if (opt && atoi(opt) > 0) + if (opt && atoi(opt) >= 0) conf_echo_failure = atoi(opt); opt = conf_get_opt("pptp", "verbose"); |