diff options
author | Antonio Quartulli <ordex@autistici.org> | 2012-08-24 17:54:07 +0200 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-10-29 09:42:41 +0100 |
commit | fdf7932052209260ca2e7add4da4b74f57976336 (patch) | |
tree | 2e235f35bda18042986db2c49b01c9b8f8ef5717 /net/batman-adv | |
parent | batman-adv: don't allow ECTP traffic on batman-adv (diff) | |
download | linux-fdf7932052209260ca2e7add4da4b74f57976336.tar.xz linux-fdf7932052209260ca2e7add4da4b74f57976336.zip |
batman-adv: properly store the roaming time
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>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/translation-table.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 42a74e31b4ab..0ac39d5f77d8 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -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; |