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/auth/auth_pap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'accel-pppd/auth/auth_pap.c') diff --git a/accel-pppd/auth/auth_pap.c b/accel-pppd/auth/auth_pap.c index 69090464..70e80819 100644 --- a/accel-pppd/auth/auth_pap.c +++ b/accel-pppd/auth/auth_pap.c @@ -242,9 +242,9 @@ static int pap_recv_req(struct pap_auth_data_t *p, struct pap_hdr_t *hdr) static void pap_recv(struct ppp_handler_t *h) { struct pap_auth_data_t *d = container_of(h, typeof(*d), h); - struct pap_hdr_t *hdr = (struct pap_hdr_t *)d->ppp->chan_buf; + struct pap_hdr_t *hdr = (struct pap_hdr_t *)d->ppp->buf; - if (d->ppp->chan_buf_size < sizeof(*hdr) || ntohs(hdr->len) < HDR_LEN || ntohs(hdr->len) < d->ppp->chan_buf_size - 2) { + if (d->ppp->buf_size < sizeof(*hdr) || ntohs(hdr->len) < HDR_LEN || ntohs(hdr->len) < d->ppp->buf_size - 2) { log_ppp_warn("PAP: short packet received\n"); return; } -- cgit v1.2.3