diff --git a/core/net/rime/trickle.c b/core/net/rime/trickle.c index 7c58a9072..3e41c9112 100644 --- a/core/net/rime/trickle.c +++ b/core/net/rime/trickle.c @@ -33,7 +33,7 @@ * * This file is part of the Contiki operating system. * - * $Id: trickle.c,v 1.16 2009/03/12 21:58:21 adamdunkels Exp $ + * $Id: trickle.c,v 1.17 2009/04/06 21:20:35 adamdunkels Exp $ */ /** @@ -164,7 +164,8 @@ recv(struct broadcast_conn *bc, rimeaddr_t *from) c->q = queuebuf_new_from_packetbuf(); c->interval_scaling = 0; reset_interval(c); - send(c); + ctimer_set(&c->first_transmission_timer, random_rand() % c->interval, + send, c); c->cb->recv(c); } } diff --git a/core/net/rime/trickle.h b/core/net/rime/trickle.h index 4f66be537..25c404f3c 100644 --- a/core/net/rime/trickle.h +++ b/core/net/rime/trickle.h @@ -45,7 +45,7 @@ * * This file is part of the Contiki operating system. * - * $Id: trickle.h,v 1.10 2009/03/12 21:58:21 adamdunkels Exp $ + * $Id: trickle.h,v 1.11 2009/04/06 21:20:35 adamdunkels Exp $ */ /** @@ -74,7 +74,7 @@ struct trickle_callbacks { struct trickle_conn { struct broadcast_conn c; const struct trickle_callbacks *cb; - struct ctimer t, interval_timer; + struct ctimer t, interval_timer, first_transmission_timer; struct pt pt; struct queuebuf *q; clock_time_t interval;