public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: correct usage of TT_CLIENT_ROAM flag
@ 2011-11-08 11:13 Antonio Quartulli
  2011-11-25  5:02 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2011-11-08 11:13 UTC (permalink / raw)
  To: b.a.t.m.a.n

The TT_CLIENT_ROAM flag has to be set in tt_global_del() only if the latter has
been invoked by the roaming_advertisement receiving routine. In case of changes
update (normal operation done on OGM/TT_QUERY receiving) this doesn't have to
happen. Moreover, a client which roamed to us has to be marked as ROAMED, not
PENDING. This will make it to be kept for consistency purposes until the related
change is received within the next OGM.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 translation-table.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/translation-table.c b/translation-table.c
index 379529d..633b35b 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -234,9 +234,11 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
 	if (tt_global_entry) {
 		/* This node is probably going to update its tt table */
 		tt_global_entry->orig_node->tt_poss_change = true;
-		/* The global entry has to be marked as PENDING and has to be
+		/* The global entry has to be marked as ROAMING and has to be
 		 * kept for consistency purpose */
-		tt_global_entry->common.flags |= TT_CLIENT_PENDING;
+		tt_global_entry->common.flags |= TT_CLIENT_ROAM;
+		tt_global_entry->roam_at = jiffies;
+
 		send_roam_adv(bat_priv, tt_global_entry->common.addr,
 			      tt_global_entry->orig_node);
 	}
@@ -357,12 +359,14 @@ static void tt_local_set_pending(struct bat_priv *bat_priv,
 				 uint16_t flags)
 {
 	tt_local_event(bat_priv, tt_local_entry->common.addr,
-		       tt_local_entry->common.flags | flags);
+		       TT_CLIENT_DEL);
 
 	/* The local client has to be marked as "pending to be removed" but has
 	 * to be kept in the table in order to send it in a full table
 	 * response issued before the net ttvn increment (consistency check) */
 	tt_local_entry->common.flags |= TT_CLIENT_PENDING;
+	/* if this is a roaming deletion, mark the local entry accordingly */
+	tt_local_entry->common.flags |= flags & TT_CLIENT_ROAM;
 }
 
 void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
@@ -1404,7 +1408,7 @@ static void _tt_update_changes(struct bat_priv *bat_priv,
 			tt_global_del(bat_priv, orig_node,
 				      (tt_change + i)->addr,
 				      "tt removed by changes",
-				      (tt_change + i)->flags & TT_CLIENT_ROAM);
+				      false);
 		else
 			if (!tt_global_add(bat_priv, orig_node,
 					   (tt_change + i)->addr, ttvn, false,
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: correct usage of TT_CLIENT_ROAM flag
  2011-11-08 11:13 [B.A.T.M.A.N.] [PATCH] batman-adv: correct usage of TT_CLIENT_ROAM flag Antonio Quartulli
@ 2011-11-25  5:02 ` Marek Lindner
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2011-11-25  5:02 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Tuesday, November 08, 2011 19:13:29 Antonio Quartulli wrote:
> The TT_CLIENT_ROAM flag has to be set in tt_global_del() only if the latter
> has been invoked by the roaming_advertisement receiving routine. In case
> of changes update (normal operation done on OGM/TT_QUERY receiving) this
> doesn't have to happen. Moreover, a client which roamed to us has to be
> marked as ROAMED, not PENDING. This will make it to be kept for
> consistency purposes until the related change is received within the next
> OGM.

Just a recap of our IRC discussion: Please split this patch as it fixes 
several unrelated issues. Also add information about whether or not these 
patches should be sent to the stable maintainers as well.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-25  5:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 11:13 [B.A.T.M.A.N.] [PATCH] batman-adv: correct usage of TT_CLIENT_ROAM flag Antonio Quartulli
2011-11-25  5:02 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox