Skip to content

Commit

Permalink
Clear all group timers before removing groups
Browse files Browse the repository at this point in the history
Ensure all group timers are stopped when stopping interfaces.

Fixes #56

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Oct 6, 2024
1 parent b8d3ac7 commit b831aea
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/vif.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,16 @@ static void stop_vif(vifi_t vifi)
*/
TAILQ_FOREACH_SAFE(al, &uv->uv_groups, al_link, tmp) {
TAILQ_REMOVE(&uv->uv_groups, al, al_link);

if (al->al_query > 0)
al->al_query = timer_clear(al->al_query);

if (al->al_timerid > 0)
al->al_timerid = timer_clear(al->al_timerid);

if (al->al_pv_timerid > 0)
al->al_pv_timerid = timer_clear(al->al_pv_timerid);

free(al);
}

Expand Down Expand Up @@ -648,6 +658,16 @@ void stop_all_vifs(void)

TAILQ_FOREACH_SAFE(al, &uv->uv_groups, al_link, tmp) {
TAILQ_REMOVE(&uv->uv_groups, al, al_link);

if (al->al_query > 0)
al->al_query = timer_clear(al->al_query);

if (al->al_timerid > 0)
al->al_timerid = timer_clear(al->al_timerid);

if (al->al_pv_timerid > 0)
al->al_pv_timerid = timer_clear(al->al_pv_timerid);

free(al);
}

Expand Down

0 comments on commit b831aea

Please sign in to comment.