X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fnet%2Fctp%2FCtpForwardingEngineP.nc;h=df59dfbbf355ca2e34774c8ad83fe5808f40118e;hb=d6e4bc62926324801eee6ea48783dce663d5b6b2;hp=65fe70086fa116590c30055e86caf6bf2c76a346;hpb=ac19889e754777ca5b8e2d697ed6fa9b2c026fb0;p=tinyos-2.x.git diff --git a/tos/lib/net/ctp/CtpForwardingEngineP.nc b/tos/lib/net/ctp/CtpForwardingEngineP.nc index 65fe7008..df59dfbb 100644 --- a/tos/lib/net/ctp/CtpForwardingEngineP.nc +++ b/tos/lib/net/ctp/CtpForwardingEngineP.nc @@ -274,9 +274,9 @@ implementation { } } - static void startRetxmitTimer(uint16_t mask, uint16_t offset) { + static void startRetxmitTimer(uint16_t window, uint16_t offset) { uint16_t r = call Random.rand16(); - r &= mask; + r %= window; r += offset; call RetxmitTimer.startOneShot(r); dbg("Forwarder", "Rexmit timer will fire in %hu ms\n", r);