diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-08-13 16:58:01 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-08-13 16:58:01 +0400 |
commit | 5c5d93e2a622bc6736267701aaaf0f472442590a (patch) | |
tree | 6ad305572f89a794922886c5a62020a083c2c1fa | |
parent | 3a0e34a252c7b5d93ee3e5804a89362c5fefc7ee (diff) | |
download | accel-ppp-5c5d93e2a622bc6736267701aaaf0f472442590a.tar.gz accel-ppp-5c5d93e2a622bc6736267701aaaf0f472442590a.zip |
lcp: fixed sending incorrect magic in lcp echo request
-rw-r--r-- | accel-pppd/ppp/ppp_lcp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c index c93c1003..e61738c6 100644 --- a/accel-pppd/ppp/ppp_lcp.c +++ b/accel-pppd/ppp/ppp_lcp.c @@ -603,7 +603,7 @@ static void lcp_recv_echo_repl(struct ppp_lcp_t *lcp, uint8_t *data, int size) if (conf_ppp_verbose) log_ppp_debug("recv [LCP EchoRep id=%x]\n", lcp->fsm.recv_id); } else { - magic = *(uint32_t *)data; + magic = ntohl(*(uint32_t *)data); if (conf_ppp_verbose) log_ppp_debug("recv [LCP EchoRep id=%x <magic %x>]\n", lcp->fsm.recv_id, magic); @@ -650,7 +650,7 @@ static void send_echo_request(struct triton_timer_t *t) .hdr.code = ECHOREQ, .hdr.id = lcp->fsm.id++, .hdr.len = htons(8), - .magic = lcp->magic, + .magic = htonl(lcp->magic), }; ++lcp->echo_sent; @@ -690,7 +690,7 @@ static void send_echo_request(struct triton_timer_t *t) } if (conf_ppp_verbose) { - log_ppp_debug("send [LCP EchoReq id=%x <magic %x>]\n", msg.hdr.id, msg.magic); + log_ppp_debug("send [LCP EchoReq id=%x <magic %x>]\n", msg.hdr.id, lcp->magic); ppp_chan_send(lcp->ppp,&msg,ntohs(msg.hdr.len)+2); } } @@ -858,7 +858,7 @@ static void lcp_recv(struct ppp_handler_t*h) break; case ECHOREQ: if (conf_ppp_verbose) - log_ppp_debug("recv [LCP EchoReq id=%x <magic %x>]\n", hdr->id, *(uint32_t*)(hdr + 1)); + log_ppp_debug("recv [LCP EchoReq id=%x <magic %x>]\n", hdr->id, ntohl(*(uint32_t*)(hdr + 1))); send_echo_reply(lcp); break; case ECHOREP: |