Skip to content

Commit c73f9d8

Browse files
jukkarkartben
authored andcommitted
net: if: Make sure IPv6 RS timer is not added twice to list
It might happen that if the network interface is going up/down fast enough, the RS timer could get inserted to the active RS timer list twice. This would then cause a forever loop in rs_timeout() when traversing the active list. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
1 parent a2ae38d commit c73f9d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/net/ip/net_if.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,11 @@ void net_if_start_rs(struct net_if *iface)
15671567
ipv6->rs_start = k_uptime_get_32();
15681568

15691569
k_mutex_lock(&lock, K_FOREVER);
1570+
1571+
/* Make sure that the RS timer is not in the list twice */
1572+
(void)sys_slist_find_and_remove(&active_rs_timers, &ipv6->rs_node);
15701573
sys_slist_append(&active_rs_timers, &ipv6->rs_node);
1574+
15711575
k_mutex_unlock(&lock);
15721576

15731577
/* FUTURE: use schedule, not reschedule. */

0 commit comments

Comments
 (0)