From: gnawali Date: Sat, 5 Dec 2009 02:59:49 +0000 (+0000) Subject: if root is unplugged and plugged back in, the network does not route to the root... X-Git-Tag: rc_6_tinyos_2_1_1~108 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=cf5ec9ed422048c623294bf69aae89c08f96be20;p=tinyos-2.x.git if root is unplugged and plugged back in, the network does not route to the root anymore, fix: properly reinitialize the link, problem reported by Maria Kazandjieva --- diff --git a/tos/lib/net/4bitle/LinkEstimatorP.nc b/tos/lib/net/4bitle/LinkEstimatorP.nc index fab06407..fd4ddf30 100644 --- a/tos/lib/net/4bitle/LinkEstimatorP.nc +++ b/tos/lib/net/4bitle/LinkEstimatorP.nc @@ -370,11 +370,6 @@ implementation { if (packetGap > 0) { NeighborTable[idx].failcnt += packetGap - 1; } - if (packetGap > MAX_PKT_GAP) { - NeighborTable[idx].failcnt = 0; - NeighborTable[idx].rcvcnt = 1; - NeighborTable[idx].inquality = 0; - } // The or with packetGap >= BLQ_PKT_WINDOW is needed in case // failcnt gets reset above @@ -384,6 +379,11 @@ implementation { updateNeighborTableEst(NeighborTable[idx].ll_addr); } + if (packetGap > MAX_PKT_GAP) { + initNeighborIdx(idx, NeighborTable[idx].ll_addr); + NeighborTable[idx].lastseq = seq; + NeighborTable[idx].rcvcnt = 1; + } }