Skip to content

Commit

Permalink
net: hsr: Fix node prune function for forget time expiry
Browse files Browse the repository at this point in the history
HSR should forget nodes after configured node forget time expiry based
on HSR_NODE_FORGET_TIME. As part of hsr_prune_nodes(), code checks to
see if entries are to be flushed out if not heard for longer than forget
time. But currently hsr_prune_nodes() is called only once during device
creation. Restart the timer at the end of hsr_prune_nodes() so that
hsr_prune_nodes() gets called periodically and forgotten entries are
removed from node table.

Signed-off-by: Aaron Kramer <[email protected]>
Signed-off-by: Murali Karicheri <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Aaron Kramer authored and davem330 committed Apr 7, 2019
1 parent fc4ecae commit 5150b45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/hsr/hsr_framereg.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ void hsr_prune_nodes(struct timer_list *t)
}
}
rcu_read_unlock();

/* Restart timer */
mod_timer(&hsr->prune_timer,
jiffies + msecs_to_jiffies(PRUNE_PERIOD));
}

void *hsr_get_next_node(struct hsr_priv *hsr, void *_pos,
Expand Down

0 comments on commit 5150b45

Please sign in to comment.