diff options
author | Aleksey Zhukov <drdaeman@drdaeman.pp.ru> | 2012-12-26 01:36:46 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-01-25 00:13:53 +0400 |
commit | afdce0b1537264067f7cbb2b0adb63b20dc5d9e7 (patch) | |
tree | 2957ca05dc8e40b0ffe16aaf3986ef9e3109f5a4 /accel-pppd/ppp | |
parent | 5cb4eede1814cacbbb50c330e938866ba777f49b (diff) | |
download | accel-ppp-afdce0b1537264067f7cbb2b0adb63b20dc5d9e7.tar.gz accel-ppp-afdce0b1537264067f7cbb2b0adb63b20dc5d9e7.zip |
Proper logging of LCP Magic-Numbers
Diffstat (limited to 'accel-pppd/ppp')
-rw-r--r-- | accel-pppd/ppp/lcp_opt_magic.c | 4 | ||||
-rw-r--r-- | accel-pppd/ppp/ppp_lcp.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/accel-pppd/ppp/lcp_opt_magic.c b/accel-pppd/ppp/lcp_opt_magic.c index 3e694d20..bf392091 100644 --- a/accel-pppd/ppp/lcp_opt_magic.c +++ b/accel-pppd/ppp/lcp_opt_magic.c @@ -94,9 +94,9 @@ static void magic_print(void (*print)(const char *fmt,...),struct lcp_option_t * struct lcp_opt32_t *opt32 = (struct lcp_opt32_t *)ptr; if (ptr) - print("<magic %04x>", ntohl(opt32->val)); + print("<magic %08x>", ntohl(opt32->val)); else - print("<magic %04x>", magic_opt->magic); + print("<magic %08x>", magic_opt->magic); } static void magic_opt_init() diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c index 7bec6294..e66bc10e 100644 --- a/accel-pppd/ppp/ppp_lcp.c +++ b/accel-pppd/ppp/ppp_lcp.c @@ -607,7 +607,7 @@ static void lcp_recv_echo_repl(struct ppp_lcp_t *lcp, uint8_t *data, int size) magic = *(uint32_t *)data; if (conf_ppp_verbose) - log_ppp_debug("recv [LCP EchoRep id=%x <magic %x>]\n", lcp->fsm.recv_id, magic); + log_ppp_debug("recv [LCP EchoRep id=%x <magic %08x>]\n", lcp->fsm.recv_id, magic); if (magic == lcp->magic) { log_ppp_error("lcp: echo: loop-back detected\n"); @@ -631,7 +631,7 @@ static void send_echo_reply(struct ppp_lcp_t *lcp) *(uint32_t *)(hdr + 1) = htonl(lcp->magic); if (conf_ppp_verbose) - log_ppp_debug("send [LCP EchoRep id=%x <magic %x>]\n", hdr->id, htonl(lcp->magic)); + log_ppp_debug("send [LCP EchoRep id=%x <magic %08x>]\n", hdr->id, lcp->magic); ppp_chan_send(lcp->ppp, hdr, ntohs(hdr->len) + 2); } @@ -684,7 +684,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, lcp->magic); + log_ppp_debug("send [LCP EchoReq id=%x <magic %08x>]\n", msg.hdr.id, lcp->magic); ppp_chan_send(lcp->ppp, &msg, ntohs(msg.hdr.len) + 2); } @@ -852,7 +852,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 %08x>]\n", hdr->id, ntohl(*(uint32_t*)(hdr + 1))); send_echo_reply(lcp); break; case ECHOREP: |