PPP, VJ: Use pbuf_take instead of duplicate copy code

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: goldsimon <[email protected]>
This commit is contained in:
Axel Lin
2017-06-20 20:26:01 +02:00
committed by goldsimon
parent fc23257ca0
commit faf74b36a4
+2 -7
View File
@@ -632,8 +632,7 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp)
}
if(LWIP_MEM_ALIGN(n0->payload) != n0->payload) {
struct pbuf *np, *q;
u8_t *bufptr;
struct pbuf *np;
#if IP_FORWARD
/* If IP forwarding is enabled we are using a PBUF_LINK packet type so
@@ -655,11 +654,7 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp)
goto bad;
}
bufptr = (u8_t*)n0->payload;
for(q = np; q != NULL; q = q->next) {
MEMCPY(q->payload, bufptr, q->len);
bufptr += q->len;
}
pbuf_take(np, n0->payload, n0->len);
if(n0->next) {
pbuf_chain(np, n0->next);