--- unmodified_aodv/aodv.cc 2008-08-28 13:43:47.000000000 +0200 +++ modified_aodv/aodv.cc 2008-08-28 13:40:39.000000000 +0200 @@ -577,8 +577,12 @@ if((ih->saddr() == index) && (ch->num_forwards() == 0)) { /* * Add the IP Header + * TCP adds the IP header too, so to avoid setting it twice, we check if this + * packet is not a TCP or ACK segment. */ - ch->size() += IP_HDR_LEN; + if(ch->ptype() != PT_TCP && ch->ptype() != PT_ACK) { + ch->size() += IP_HDR_LEN; + } // Added by Parag Dadhania && John Novatnack to handle broadcasting if ( (u_int32_t)ih->daddr() != IP_BROADCAST) ih->ttl_ = NETWORK_DIAMETER;