mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 09:16:20 +00:00
PPP, VJ: Use pbuf_clone to replace pbuf_alloc+pbuf_copy
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: goldsimon <goldsimon@gmx.de>
This commit is contained in:
parent
ecd6c7ceae
commit
a92a281455
@ -202,16 +202,11 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf **pb)
|
||||
|
||||
/* TCP stack requires that we don't change the packet payload, therefore we copy
|
||||
* the whole packet before compression. */
|
||||
np = pbuf_alloc(PBUF_RAW, np->tot_len, PBUF_POOL);
|
||||
np = pbuf_clone(PBUF_RAW, PBUF_POOL, *pb);
|
||||
if (!np) {
|
||||
return (TYPE_IP);
|
||||
}
|
||||
|
||||
if (pbuf_copy(np, *pb) != ERR_OK) {
|
||||
pbuf_free(np);
|
||||
return (TYPE_IP);
|
||||
}
|
||||
|
||||
*pb = np;
|
||||
ip = (struct ip_hdr *)np->payload;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user