The following commit has been merged in the merge/master branch:
commit 0fa214b2307ec8df272bb16c66248b3f1a3e4c84
Merge: d10c9a39f7d9b8e0de60e6e6897c5d3ecf60e9e1 dc96f5b62bfbac7ea0a5f53ed9795ad262daad91
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Wed Dec 7 02:23:04 2011 +0800
Merge remote-tracking branch 'origin/standalone/next' into merge/master
diff --combined net/batman-adv/gateway_client.c
index 9373a14,24403a7..24403a7
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@@ -695,7 -695,7 +695,7 @@@ bool gw_out_of_range(struct bat_priv *b
}
neigh_old = find_router(bat_priv, orig_dst_node, NULL);
- if (!!neigh_old)
+ if (!neigh_old)
goto out;
if (curr_tq_avg - neigh_old->tq_avg > GW_THRESHOLD)
diff --combined net/batman-adv/routing.c
index ef24a72,773e606..773e606
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@@ -627,8 -627,7 +627,7 @@@ int recv_tt_query(struct sk_buff *skb,
/* Ensure we have all the claimed data */
if (unlikely(skb_headlen(skb) <
- sizeof(struct tt_query_packet) +
- tt_len))
+ sizeof(struct tt_query_packet) + tt_len))
goto out;
handle_tt_response(bat_priv, tt_query);
diff --combined net/batman-adv/translation-table.c
index cc87acf,58361ed..58361ed
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@@ -242,9 -242,10 +242,10 @@@ void tt_local_add(struct net_device *so
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);
}
@@@ -661,6 -662,7 +662,7 @@@ void tt_global_del(struct bat_priv *bat
const char *message, bool roaming)
{
struct tt_global_entry *tt_global_entry = NULL;
+ struct tt_local_entry *tt_local_entry = NULL;
tt_global_entry = tt_global_hash_find(bat_priv, addr);
if (!tt_global_entry)
@@@ -668,15 -670,29 +670,29 @@@
if (tt_global_entry->orig_node == orig_node) {
if (roaming) {
- tt_global_entry->common.flags |= TT_CLIENT_ROAM;
- tt_global_entry->roam_at = jiffies;
- goto out;
+ /* if we are deleting a global entry due to a roam
+ * event, there are two possibilities:
+ * 1) the client roamed from node A to node B => we mark
+ * it with TT_CLIENT_ROAM, we start a timer and we
+ * wait for node B to claim it. In case of timeout
+ * the entry is purged.
+ * 2) the client roamed to us => we can directly delete
+ * the global entry, since it is useless now. */
+ tt_local_entry = tt_local_hash_find(bat_priv,
+ tt_global_entry->common.addr);
+ if (!tt_local_entry) {
+ tt_global_entry->common.flags |= TT_CLIENT_ROAM;
+ tt_global_entry->roam_at = jiffies;
+ goto out;
+ }
}
_tt_global_del(bat_priv, tt_global_entry, message);
}
out:
if (tt_global_entry)
tt_global_entry_free_ref(tt_global_entry);
+ if (tt_local_entry)
+ tt_local_entry_free_ref(tt_local_entry);
}
void tt_global_del_orig(struct bat_priv *bat_priv,
--
linux integration