summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp/ppp_lcp.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-03-19 21:46:32 +0400
committerDmitry Kozlov <xeb@mail.ru>2014-03-19 21:46:32 +0400
commit2c2977c2036b3b0e80a71337f2bdee5a14ac2823 (patch)
tree9bcba12966e124bed9aedd4e3f6ad238f5e2ae2d /accel-pppd/ppp/ppp_lcp.c
parent4654e90f1903756523808afd6a00112060c67dc2 (diff)
downloadaccel-ppp-2c2977c2036b3b0e80a71337f2bdee5a14ac2823.tar.gz
accel-ppp-2c2977c2036b3b0e80a71337f2bdee5a14ac2823.zip
ppp: fixed magic endianness
Diffstat (limited to 'accel-pppd/ppp/ppp_lcp.c')
-rw-r--r--accel-pppd/ppp/ppp_lcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c
index 12ec24ba..5975d5db 100644
--- a/accel-pppd/ppp/ppp_lcp.c
+++ b/accel-pppd/ppp/ppp_lcp.c
@@ -604,7 +604,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 %08x>]\n", lcp->fsm.recv_id, magic);
@@ -651,7 +651,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;