From: gnawali Date: Fri, 14 Aug 2009 18:09:43 +0000 (+0000) Subject: fix bug - testing for large enough packetGap to recompute estimate is not enough... X-Git-Tag: rc_6_tinyos_2_1_1~339 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=5a3ac82923305d21abfc0a924a3621fb34d91245;p=tinyos-2.x.git fix bug - testing for large enough packetGap to recompute estimate is not enough. Reported by Mehmet Akif Antepli and Scott Moeller --- diff --git a/tos/lib/net/4bitle/LinkEstimatorP.nc b/tos/lib/net/4bitle/LinkEstimatorP.nc index 6738a9f8..130d6415 100644 --- a/tos/lib/net/4bitle/LinkEstimatorP.nc +++ b/tos/lib/net/4bitle/LinkEstimatorP.nc @@ -376,7 +376,11 @@ implementation { NeighborTable[idx].inquality = 0; } - if (packetGap >= BLQ_PKT_WINDOW) { + // The or with packetGap >= BLQ_PKT_WINDOW is needed in case + // failcnt gets reset above + + if (((NeighborTable[idx].rcvcnt + NeighborTable[idx].failcnt) >= BLQ_PKT_WINDOW) + || (packetGap >= BLQ_PKT_WINDOW)) { updateNeighborTableEst(NeighborTable[idx].ll_addr); }