]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
fix exotic backoff bug, check validity of duplicate supression table first
authorandreaskoepke <andreaskoepke>
Fri, 13 Jul 2007 16:48:27 +0000 (16:48 +0000)
committerandreaskoepke <andreaskoepke>
Fri, 13 Jul 2007 16:48:27 +0000 (16:48 +0000)
tos/chips/tda5250/mac/RedMacP.nc

index b51f4ae64eedbfb94368145a837d4c6d12ca0e5e..164813de6f9177edbfd9c03c41b5e4f14d969271 100644 (file)
@@ -535,9 +535,9 @@ implementation
         bool rVal = TRUE;
         uint8_t i;
         for(i=0; i < MSG_TABLE_ENTRIES; i++) {
-            if((getHeader(msg)->src == knownMsgTable[i].src) &&
-               (((getHeader(msg)->token) & TOKEN_ACK_MASK) == knownMsgTable[i].token) &&
-               (knownMsgTable[i].age < MAX_AGE)) {
+            if((knownMsgTable[i].age < MAX_AGE) &&
+               (getHeader(msg)->src == knownMsgTable[i].src) &&
+               (((getHeader(msg)->token) & TOKEN_ACK_MASK) == knownMsgTable[i].token)) {
                 knownMsgTable[i].age = 0;
                 rVal = FALSE;
                 break;
@@ -983,8 +983,10 @@ implementation
                 }
                 else {
                     sdDebug(203);
-                    updateLongRetryCounters();
-                    action = RX;
+                    updateLongRetryCounters(); // this will eventually schedule the right backoff
+                    macState = SLEEP;          // so much traffic is going on -- take a nap
+                    setSleepMode();
+                    action = INIT;             // a difficult way to say: do nothing
                 }
             }
             else {