Hi,
this is where I suspect the bug : LinkEstimatorP.nc
**********************************
 j = 0;
 newPrevSentIdx = 0;
NEIGHBOR_TABLE_SIZE = 10 // I added to have all the constants mentionned
    for (i = 0; i < NEIGHBOR_TABLE_SIZE && j < maxEntries; i++) {
      k = (prevSentIdx + i + 1) % NEIGHBOR_TABLE_SIZE;
      if ((NeighborTable[k].flags & VALID_ENTRY) &&
   (NeighborTable[k].flags & MATURE_ENTRY)) {
 footer->neighborList[j].ll_addr = NeighborTable[k].ll_addr;
 footer->neighborList[j].inquality = NeighborTable[k].inquality;
 newPrevSentIdx = k;
 dbg("LI", "Loaded on footer: %d %d %d\n", j, footer->neighborList[j].ll_addr,
     footer->neighborList[j].inquality);
 j++;
      }
    }
***********************************
Normally footer->neighborList[] should contain distinct neighbour but in the 
case where the second and last element in the 
NeighborTable are mature and valid only element index 1 will be insert. Isn't 
it?
I explain more:
k = 0 + 0 + 1 % 10 = 1 (NeighborTable[1] is mature and valid) then 
 footer->neighborList[0].ll_addr = NeighborTable[1].ll_addr;
 footer->neighborList[0].inquality = NeighborTable[1].inquality;
then we continue until * i = 9 * 
k = 1 + 9 + 1 = 11 % 10 = 1 (NeighborTable[1] is mature and valid) then 
 footer->neighborList[1].ll_addr = NeighborTable[1].ll_addr;
 footer->neighborList[1].inquality = NeighborTable[1].inquality;
=============> duplication !!!
Is it right my conclusion?
Thank you very much
Fun

__________________________________________________
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible 
contre les messages non sollicités 
http://mail.yahoo.fr Yahoo! Mail 
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to