Skip to content

Commit

Permalink
batman-adv: properly store the roaming time
Browse files Browse the repository at this point in the history
in case of a new global entry added because of roaming, the roam_at field must
be properly initiated with the current time. This value will be later use to
purge this entry out on time out (if nobody claims it). Instead roam_at field
is now set to zero in this situation leading to an immediate purging of the
related entry.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  • Loading branch information
Antonio Quartulli committed Oct 29, 2012
1 parent 4934ab9 commit fdf7932
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,12 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv,

common->flags = flags;
tt_global_entry->roam_at = 0;
/* node must store current time in case of roaming. This is
* needed to purge this entry out on timeout (if nobody claims
* it)
*/
if (flags & BATADV_TT_CLIENT_ROAM)
tt_global_entry->roam_at = jiffies;
atomic_set(&common->refcount, 2);
common->added_at = jiffies;

Expand Down

0 comments on commit fdf7932

Please sign in to comment.