/[lwip]/lwip/src/netif/ppp/vj.c
ViewVC logotype

Diff of /lwip/src/netif/ppp/vj.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by jani, Fri May 30 08:49:34 2003 UTC revision 1.3 by marcbou, Thu Jun 19 11:31:25 2003 UTC
# Line 574  int vj_uncompress_tcp( Line 574  int vj_uncompress_tcp(
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    
# Line 585  int vj_uncompress_tcp( Line 612  int vj_uncompress_tcp(
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;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26