diff options
author | Kozlov Dmitry <dima@server> | 2011-05-31 13:23:44 +0400 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2011-05-31 13:23:44 +0400 |
commit | 717647882aaeba977acb7b866e9d03db49e5d62f (patch) | |
tree | d6ff54849989af08ea4babd5fa8600505b3d6535 | |
parent | bb2b8ea67805b1b4db4f924066b5d14c0c037191 (diff) | |
download | accel-ppp-717647882aaeba977acb7b866e9d03db49e5d62f.tar.gz accel-ppp-717647882aaeba977acb7b866e9d03db49e5d62f.zip |
ppp: treat peer's lcp echo request as lcp echo activity and don't drop connection if there is no peer's echo reply
-rw-r--r-- | accel-pppd/ppp/ppp_lcp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c index 048ada5..fa23436 100644 --- a/accel-pppd/ppp/ppp_lcp.c +++ b/accel-pppd/ppp/ppp_lcp.c @@ -586,6 +586,7 @@ static void lcp_recv_echo_repl(struct ppp_lcp_t *lcp, uint8_t *data, int size) } } + lcp->fsm.id++; lcp->echo_sent = 0; } @@ -594,6 +595,8 @@ static void send_echo_reply(struct ppp_lcp_t *lcp) struct lcp_hdr_t *hdr = (struct lcp_hdr_t*)lcp->ppp->buf; //uint32_t magic = *(uint32_t *)(hdr + 1); + lcp->echo_sent = 0; + hdr->code = ECHOREP; *(uint32_t *)(hdr + 1) = htonl(lcp->magic); @@ -613,7 +616,7 @@ static void send_echo_request(struct triton_timer_t *t) } __attribute__((packed)) msg = { .hdr.proto = htons(PPP_LCP), .hdr.code = ECHOREQ, - .hdr.id = ++lcp->fsm.id, + .hdr.id = lcp->fsm.id, .hdr.len = htons(8), .magic = lcp->magic, }; |