From b763fcedb235d2e100c25b0accc15d917880c3e0 Mon Sep 17 00:00:00 2001 From: gnawali Date: Sun, 11 Apr 2010 23:27:30 +0000 Subject: [PATCH] bufix the g in dup check. identified by Xiaohui Liu --- tos/lib/net/ctp/CtpForwardingEngineP.nc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tos/lib/net/ctp/CtpForwardingEngineP.nc b/tos/lib/net/ctp/CtpForwardingEngineP.nc index 964e35a5..379bafdb 100644 --- a/tos/lib/net/ctp/CtpForwardingEngineP.nc +++ b/tos/lib/net/ctp/CtpForwardingEngineP.nc @@ -703,8 +703,8 @@ implementation { } //... and in the queue for duplicates if (call SendQueue.size() > 0) { - for (i = call SendQueue.size(); --i;) { - qe = call SendQueue.element(i); + for (i = call SendQueue.size(); i >0; i--) { + qe = call SendQueue.element(i-1); if (call CtpPacket.matchInstance(qe->msg, msg)) { duplicate = TRUE; break; @@ -736,16 +736,12 @@ implementation { event message_t* SubSnoop.receive(message_t* msg, void *payload, uint8_t len) { - //am_addr_t parent = call UnicastNameFreeRouting.nextHop(); - am_addr_t proximalSrc = call AMPacket.source(msg); - // Check for the pull bit (P) [TEP123] and act accordingly. This // check is made for all packets, not just ones addressed to us. if (call CtpPacket.option(msg, CTP_OPT_PULL)) { call CtpInfo.triggerRouteUpdate(); } - call CtpInfo.setNeighborCongested(proximalSrc, call CtpPacket.option(msg, CTP_OPT_ECN)); return signal Snoop.receive[call CtpPacket.getType(msg)] (msg, payload + sizeof(ctp_data_header_t), len - sizeof(ctp_data_header_t)); -- 2.39.2