mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 12:13:47 +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) {
|
if(LWIP_MEM_ALIGN(n0->payload) != n0->payload) {
|
||||||
struct pbuf *np, *q;
|
struct pbuf *np;
|
||||||
u8_t *bufptr;
|
|
||||||
|
|
||||||
#if IP_FORWARD
|
#if IP_FORWARD
|
||||||
/* If IP forwarding is enabled we are using a PBUF_LINK packet type so
|
/* 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;
|
goto bad;
|
||||||
}
|
}
|
||||||
|
|
||||||
bufptr = (u8_t*)n0->payload;
|
pbuf_take(np, n0->payload, n0->len);
|
||||||
for(q = np; q != NULL; q = q->next) {
|
|
||||||
MEMCPY(q->payload, bufptr, q->len);
|
|
||||||
bufptr += q->len;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(n0->next) {
|
if(n0->next) {
|
||||||
pbuf_chain(np, n0->next);
|
pbuf_chain(np, n0->next);
|
||||||
|
Loading…
Reference in New Issue
Block a user