summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/pptp/pptp.c
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@mail.ru>2017-01-28 02:39:19 +0500
committerVladislav Grishenko <themiron@mail.ru>2017-12-05 17:24:53 +0500
commit528b83c33e5b03467fda5dbb1cb398bb4795fa7b (patch)
tree34fe917c08d8722f717d974889d61999292697ce /accel-pppd/ctrl/pptp/pptp.c
parent9ed37b916509d02e2296e39f5210d1d8f4999e95 (diff)
downloadaccel-ppp-528b83c33e5b03467fda5dbb1cb398bb4795fa7b.tar.gz
accel-ppp-528b83c33e5b03467fda5dbb1cb398bb4795fa7b.zip
pptp: fix and allow to disable echo failures counting
Sent echos counter is overloaded with random icmp id, so echo-failure setting is either ignored or causes random pptp channel stops within valid accumulated fail count range, i.e on the the first fail. Since icmp id is not actually used for checking, fix issue by dropping overload. Default echo-failure value is 3, so allow endless echo fails without channel drop by setting echo-failure to 0.
Diffstat (limited to 'accel-pppd/ctrl/pptp/pptp.c')
-rw-r--r--accel-pppd/ctrl/pptp/pptp.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c
index 99958cc8..03f6e980 100644
--- a/accel-pppd/ctrl/pptp/pptp.c
+++ b/accel-pppd/ctrl/pptp/pptp.c
@@ -423,13 +423,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 +440,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 +757,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");