]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/ctp/CtpForwardingEngineP.nc
because we changed the type for length in Intercept.forward
[tinyos-2.x.git] / tos / lib / net / ctp / CtpForwardingEngineP.nc
index 55893c7c9b0b950212650405eae705f814f2d174..38dfc10672dcb9ac948015d8c9b4113a9bf14796 100644 (file)
@@ -684,9 +684,11 @@ implementation {
         // Loop-detection code:
         if (call CtpInfo.getEtx(&gradient) == SUCCESS) {
           // We only check for loops if we know our own metric
-          if (call CtpPacket.getEtx(m) < gradient) {
-            // The incoming packet's metric (gradient) is less than our
-            // own gradient.  Trigger a route update and backoff.
+          if (call CtpPacket.getEtx(m) <= gradient) {
+            // If our etx metric is less than or equal to the etx value
+           // on the packet (etx of the previous hop node), then we believe
+           // we are in a loop.
+           // Trigger a route update and backoff.
             call CtpInfo.triggerImmediateRouteUpdate();
             startRetxmitTimer(LOOPY_WINDOW, LOOPY_OFFSET);
             call CollectionDebug.logEventMsg(NET_C_FE_LOOP_DETECTED,
@@ -748,7 +750,7 @@ implementation {
     call CollectionDebug.logEventMsg(NET_C_FE_RCV_MSG,
                                         call CollectionPacket.getSequenceNumber(msg), 
                                         call CollectionPacket.getOrigin(msg), 
-                                         call AMPacket.destination(msg));
+                                    thl--);
     if (len > call SubSend.maxPayloadLength()) {
       return msg;
     }
@@ -919,7 +921,7 @@ implementation {
 
   default event bool
   Intercept.forward[collection_id_t collectid](message_t* msg, void* payload, 
-                                               uint16_t len) {
+                                               uint8_t len) {
     return TRUE;
   }