* [B.A.T.M.A.N.] [PATCH] batman-adv: properly store the roaming time
@ 2012-08-24 15:54 Antonio Quartulli
2012-09-02 8:30 ` Marek Lindner
0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2012-08-24 15:54 UTC (permalink / raw)
To: b.a.t.m.a.n
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>
---
translation-table.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/translation-table.c b/translation-table.c
index cacf7b7..ce3bf00 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -744,6 +744,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;
--
1.7.9.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: properly store the roaming time
2012-08-24 15:54 [B.A.T.M.A.N.] [PATCH] batman-adv: properly store the roaming time Antonio Quartulli
@ 2012-09-02 8:30 ` Marek Lindner
0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2012-09-02 8:30 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On Friday, August 24, 2012 23:54:07 Antonio Quartulli wrote:
> 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>
> ---
> translation-table.c | 6 ++++++
> 1 file changed, 6 insertions(+)
Applied in revision 700ae88.
Thanks,
Marek
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-02 8:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24 15:54 [B.A.T.M.A.N.] [PATCH] batman-adv: properly store the roaming time Antonio Quartulli
2012-09-02 8:30 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox