diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2011-02-13 01:10:57 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2011-02-13 01:10:57 +0300 |
commit | 04dafabeda3a05145173a6dadc869ad5b3aeadd7 (patch) | |
tree | 51c196f179a179fa26c94bff1588ac1cd59a375d /accel-pppd/ppp | |
parent | 28169388eba3c9615be98588557fcaeb87da1874 (diff) | |
download | accel-ppp-04dafabeda3a05145173a6dadc869ad5b3aeadd7.tar.gz accel-ppp-04dafabeda3a05145173a6dadc869ad5b3aeadd7.zip |
ppp: don't raise error if lcp echo reply received without magic
Diffstat (limited to 'accel-pppd/ppp')
-rw-r--r-- | accel-pppd/ppp/ppp_lcp.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c index c46c5a49..1401b551 100644 --- a/accel-pppd/ppp/ppp_lcp.c +++ b/accel-pppd/ppp/ppp_lcp.c @@ -569,19 +569,21 @@ static int lcp_recv_conf_ack(struct ppp_lcp_t *lcp, uint8_t *data, int size) static void lcp_recv_echo_repl(struct ppp_lcp_t *lcp, uint8_t *data, int size) { - uint32_t magic = *(uint32_t *)data; + uint32_t magic; if (size != 4) { - log_ppp_error("lcp:echo: magic number size mismatch\n"); - ppp_terminate(lcp->ppp, TERM_USER_ERROR, 0); - } + if (conf_ppp_verbose) + log_ppp_debug("recv [LCP EchoRep id=%x]\n", lcp->fsm.recv_id); + } else { + magic = *(uint32_t *)data; - if (conf_ppp_verbose) - log_ppp_debug("recv [LCP EchoRep id=%x <magic %x>]\n", lcp->fsm.recv_id, magic); + if (conf_ppp_verbose) + log_ppp_debug("recv [LCP EchoRep id=%x <magic %x>]\n", lcp->fsm.recv_id, magic); - if (magic == lcp->magic) { - log_ppp_error("lcp: echo: loop-back detected\n"); - ppp_terminate(lcp->ppp, TERM_NAS_ERROR, 0); + if (magic == lcp->magic) { + log_ppp_error("lcp: echo: loop-back detected\n"); + ppp_terminate(lcp->ppp, TERM_NAS_ERROR, 0); + } } lcp->echo_sent = 0; |