summaryrefslogtreecommitdiff
path: root/net/batman-adv/translation-table.h
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2012-03-16 21:03:28 +0400
committerAntonio Quartulli <ordex@autistici.org>2012-05-13 21:06:38 +0400
commit3275e7cc84fb0574e9662e8e74c3b1dab38f7143 (patch)
tree5b25994ef56baa80d29f8f3ee9c236a8449bb8bf /net/batman-adv/translation-table.h
parent8710e2613a4819aac44f4aed7e29027ac3eeb683 (diff)
downloadlinux-3275e7cc84fb0574e9662e8e74c3b1dab38f7143.tar.xz
batman-adv: improve unicast packet (re)routing
In case of a client X roaming from a generic node A to another node B, it is possible that a third node C gets A's OGM but not B's. At this point in time, if C wants to send data to X it will send a unicast packet destined to A. The packet header will contain A's last ttvn (C got A's OGM and so it knows it). The packet will travel towards A without being intercepted because the ttvn contained in its header is the newest for A. Once A will receive the packet, A's state will not report to be in a "roaming phase" (because, after a roaming, once A sends out its OGM, all the changes are committed and the node is considered not to be in the roaming state anymore) and it will match the ttvn carried by the packet. Therefore there is no reason for A to try to alter the packet's route, thus dropping the packet because the destination client is not there anymore. However, C is well aware that it's routing information towards the client X is outdated as it received an OGM from A saying that the client roamed away. Thanks to this detail, this patch introduces a small change in behaviour: as long as C is in the state of not knowing the new location of client X it will forward the traffic to its last known location using ttvn-1 of the destination. By using an older ttvn node A will be forced to re-route the packet. Intermediate nodes are also allowed to update the packet's destination as long as they have the information about the client's new location. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/translation-table.h')
-rw-r--r--net/batman-adv/translation-table.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/batman-adv/translation-table.h b/net/batman-adv/translation-table.h
index 593d1b31217c..c43374dc364d 100644
--- a/net/batman-adv/translation-table.h
+++ b/net/batman-adv/translation-table.h
@@ -53,5 +53,7 @@ bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst);
void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
const unsigned char *tt_buff, uint8_t tt_num_changes,
uint8_t ttvn, uint16_t tt_crc);
+bool tt_global_client_is_roaming(struct bat_priv *bat_priv, uint8_t *addr);
+
#endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */