X-Git-Url: http://sjero.net/git/?p=dccp2tcp;a=blobdiff_plain;f=encap.c;h=f583f0994303568d4aeb2d62ffc19f99a7e594aa;hp=f729878763594e9ceb9d5f6f5809f1670f4793ee;hb=926ed1e125b42109bdc91e56ed256f26d618319b;hpb=17c4c31c730832fa2a8a864ae719294935cb4241 diff --git a/encap.c b/encap.c index f729878..f583f09 100644 --- a/encap.c +++ b/encap.c @@ -23,12 +23,12 @@ Date: 11/2012 Notes: 1)CCID2 ONLY 2)DCCP MUST use 48 bit sequence numbers - 3)Checksums are not computed (they are zeroed) - 4)DCCP DATA packets are not implemented (Linux doesn't use them) - 5)DCCP Ack packets show up as TCP packets containing one byte + 3)DCCP DATA packets are not implemented (Linux doesn't use them) + 4)DCCP Ack packets show up as TCP packets containing one byte ******************************************************************************/ #include "dccp2tcp.h" #include "encap.h" +#include "checksums.h" #include #include @@ -279,6 +279,10 @@ 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(new->length); + /*Compute IPv4 Checksum*/ + iph->check=0; + iph->check=ipv4_chksum(new->data,iph->ihl*4); + /*Cleanup*/ free(nnew.src_id); free(nnew.dest_id);