Skip to content

Commit

Permalink
net: trickle: Re-init trickle timer for multiple triggerings
Browse files Browse the repository at this point in the history
We need to re-initialize the trickle->timer delayed work to use
trickle_timeout() if there are multiple triggerings.

Fixes #15606

Signed-off-by: ling wei <[email protected]>
  • Loading branch information
lingwei901011 committed Apr 24, 2019
1 parent d823658 commit 71d5e3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion subsys/net/ip/trickle.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ LOG_MODULE_REGISTER(net_trickle, CONFIG_NET_TRICKLE_LOG_LEVEL);

#define TICK_MAX ~0

static void trickle_timeout(struct k_work *work);

static inline bool is_suppression_disabled(struct net_trickle *trickle)
{
return trickle->k == NET_TRICKLE_INFINITE_REDUNDANCY;
Expand Down Expand Up @@ -77,7 +79,7 @@ static void double_interval_timeout(struct k_work *work)
NET_DBG("doubling time %u", rand_time);

trickle->Istart = k_uptime_get_32() + rand_time;

k_delayed_work_init(&trickle->timer, trickle_timeout);
k_delayed_work_submit(&trickle->timer, rand_time);

NET_DBG("last end %u new end %u for %u I %u",
Expand Down

0 comments on commit 71d5e3a

Please sign in to comment.