From c783f297faa2453daca7189182a17f913e003ccc Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Mon, 17 Jan 2011 18:08:11 +0300 Subject: memory usage optimization --- accel-pppd/ppp/ppp_lcp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'accel-pppd/ppp/ppp_lcp.c') diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c index e40e321..63fe8ff 100644 --- a/accel-pppd/ppp/ppp_lcp.c +++ b/accel-pppd/ppp/ppp_lcp.c @@ -252,7 +252,7 @@ static int send_conf_req(struct ppp_fsm_t *fsm) static void send_conf_ack(struct ppp_fsm_t *fsm) { struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm); - struct lcp_hdr_t *hdr = (struct lcp_hdr_t*)lcp->ppp->chan_buf; + struct lcp_hdr_t *hdr = (struct lcp_hdr_t*)lcp->ppp->buf; hdr->code = CONFACK; @@ -265,7 +265,7 @@ static void send_conf_ack(struct ppp_fsm_t *fsm) static void send_code_rej(struct ppp_fsm_t *fsm) { struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm); - struct lcp_hdr_t *hdr = (struct lcp_hdr_t*)lcp->ppp->chan_buf; + struct lcp_hdr_t *hdr = (struct lcp_hdr_t*)lcp->ppp->buf; hdr->code = CONFACK; @@ -586,7 +586,7 @@ static void lcp_recv_echo_repl(struct ppp_lcp_t *lcp, uint8_t *data, int size) static void send_echo_reply(struct ppp_lcp_t *lcp) { - struct lcp_hdr_t *hdr = (struct lcp_hdr_t*)lcp->ppp->chan_buf; + struct lcp_hdr_t *hdr = (struct lcp_hdr_t*)lcp->ppp->buf; uint32_t magic = *(uint32_t *)(hdr + 1); hdr->code = ECHOREP; @@ -706,12 +706,12 @@ static void lcp_recv(struct ppp_handler_t*h) return; } - if (lcp->ppp->chan_buf_size < PPP_HEADERLEN + 2) { + if (lcp->ppp->buf_size < PPP_HEADERLEN + 2) { log_ppp_warn("LCP: short packet received\n"); return; } - hdr = (struct lcp_hdr_t *)lcp->ppp->chan_buf; + hdr = (struct lcp_hdr_t *)lcp->ppp->buf; if (ntohs(hdr->len) < PPP_HEADERLEN) { log_ppp_warn("LCP: short packet received\n"); return; -- cgit v1.2.3