574 |
/* Remove the compressed header and prepend the uncompressed header. */ |
/* Remove the compressed header and prepend the uncompressed header. */ |
575 |
pbuf_header(n0, -vjlen); |
pbuf_header(n0, -vjlen); |
576 |
|
|
577 |
|
if(MEM_ALIGN(n0->payload) != n0->payload) { |
578 |
|
struct pbuf *np, *q; |
579 |
|
u8_t *bufptr; |
580 |
|
|
581 |
|
np = pbuf_alloc(PBUF_RAW, n0->len + cs->cs_hlen, PBUF_POOL); |
582 |
|
if(!np) { |
583 |
|
PPPDEBUG((LOG_WARNING, "vj_uncompress_tcp: realign failed\n")); |
584 |
|
*nb = NULL; |
585 |
|
goto bad; |
586 |
|
} |
587 |
|
|
588 |
|
pbuf_header(np, -cs->cs_hlen); |
589 |
|
|
590 |
|
bufptr = n0->payload; |
591 |
|
for(q = np; q != NULL; q = q->next) { |
592 |
|
memcpy(q->payload, bufptr, q->len); |
593 |
|
bufptr += q->len; |
594 |
|
} |
595 |
|
|
596 |
|
if(n0->next) { |
597 |
|
pbuf_chain(np, n0->next); |
598 |
|
pbuf_dechain(n0); |
599 |
|
} |
600 |
|
pbuf_free(n0); |
601 |
|
n0 = np; |
602 |
|
} |
603 |
|
|
604 |
if(pbuf_header(n0, cs->cs_hlen)) { |
if(pbuf_header(n0, cs->cs_hlen)) { |
605 |
struct pbuf *np; |
struct pbuf *np; |
606 |
|
|
612 |
goto bad; |
goto bad; |
613 |
} |
} |
614 |
pbuf_chain(np, n0); |
pbuf_chain(np, n0); |
615 |
|
pbuf_free(n0); |
616 |
n0 = np; |
n0 = np; |
617 |
} |
} |
618 |
|
LWIP_ASSERT("n0->len >= cs->cs_hlen", n0->len >= cs->cs_hlen); |
619 |
memcpy(n0->payload, &cs->cs_ip, cs->cs_hlen); |
memcpy(n0->payload, &cs->cs_ip, cs->cs_hlen); |
620 |
|
|
621 |
*nb = n0; |
*nb = n0; |