[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] bug in dsdv.cc



Hi,

I found a bug in dsdv.cc. One line has to be added to fix it.


void
DSDV_Agent::forwardPacket (Packet * p)
{

......

  else
    { // Brand new destination
      rtable_ent rte;
      double now = s.clock();
      
      bzero(&rte, sizeof(rte));
      rte.dst = dst;
      rte.hop = dst;
      rte.metric = BIG;
      rte.seqnum = 0;

      rte.advertise_ok_at = now + 604800;	// check back next week... :)
      rte.changed_at = now;
      rte.new_seqnum_at = now;	// was now + wst0_, why??? XXX -dam
      rte.wst = wst0_;
      rte.timeout_event = 0;

      rte.q = new PacketQueue();

//
// To prevent adding the IP Header twice!!
// The IP Header, which has been
// added in the recv function just before 
// must be removed, before adding it again
//

+      hdrc->size() -= IP_HDR_LEN;    // Rankster


      rte.q->enque(p);
	  
      assert (rte.q->length() == 1 && 1 <= MAX_QUEUE_LENGTH);
      table_->AddEntry(rte);
      
      if (verbose_)
	      trace ("VBP %.5f _%d_ %d:%d -> %d:%d", now, myaddr_,
		     iph->saddr(), iph->sport(), iph->daddr(), iph->dport());
      return;
    }

}


Bye,

Stefan