mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-17 17:10:03 +00:00
PPP, VJ: Use pbuf_take instead of duplicate copy code
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: goldsimon <goldsimon@gmx.de>
This commit is contained in:
parent
fc23257ca0
commit
faf74b36a4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user