From cf5ec9ed422048c623294bf69aae89c08f96be20 Mon Sep 17 00:00:00 2001 From: gnawali Date: Sat, 5 Dec 2009 02:59:49 +0000 Subject: [PATCH] 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 --- tos/lib/net/4bitle/LinkEstimatorP.nc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; + } } -- 2.39.2