]> sjero.net Git - dccp2tcp/blobdiff - encap.c
Update Changelog, Release Notes, and File Headers for release 1.5
[dccp2tcp] / encap.c
diff --git a/encap.c b/encap.c
index b932bda706b1b04fdf56d150f5437e4e7e474fa5..736cf3a3d06c3684dc757fe309c6aa9a23baa602 100644 (file)
--- a/encap.c
+++ b/encap.c
@@ -1,7 +1,7 @@
 /******************************************************************************
 Author: Samuel Jero
 
-Date: 7/2011
+Date: 11/2011
 
 Description: Encapsulation Functions for DCCP conversion to TCP
 
@@ -74,6 +74,8 @@ int ethernet_encap(struct packet *new, const struct const_packet *old)
                nnew.data= new->data + sizeof(struct ether_header);
                nold.length= old->length - sizeof(struct ether_header);
                nnew.length= new->length - sizeof(struct ether_header);
+               nnew.h=new->h;
+               nold.h=old->h;
 
                /*Select Next Protocol*/
                switch(ntohs(ethh->ether_type)){
@@ -121,6 +123,8 @@ int ipv4_encap(struct packet *new, const struct const_packet *old)
                nnew.data= new->data +iph->ihl*4;
                nold.length= old->length -iph->ihl*4;
                nnew.length= new->length -iph->ihl*4;
+               nnew.h=new->h;
+               nold.h=old->h;
 
                /*Confirm that this is IPv4*/
                if(iph->version!=4){
@@ -158,7 +162,7 @@ int ipv4_encap(struct packet *new, const struct const_packet *old)
                }
 
                /*Adjust IPv4 header to account for packet's total length*/
-               iph->tot_len=htons(nnew.length);
+               iph->tot_len=htons(new->length);
 return 1;
 }
 
@@ -190,6 +194,8 @@ int linux_cooked_encap(struct packet *new, const struct const_packet *old)
        nnew.data= new->data + sizeof(struct sll_header);
        nold.length= old->length - sizeof(struct sll_header);
        nnew.length= new->length- sizeof(struct sll_header);
+       nnew.h=new->h;
+       nold.h=old->h;
 
        /*Confirm that this is SLL*/
        if(ntohs(slh->sll_pkttype) > 4){