diff options
author | Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de> | 2012-01-22 14:00:23 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-04-11 08:28:59 -0400 |
commit | 20ff9d593f8ff20c2ef24498f77a8bc30b3a059a (patch) | |
tree | e64f51254b230d9d6441e09a2c81fbcb68dcf2d6 /net/batman-adv/translation-table.c | |
parent | db08e6e557ebc8ffedf6530693937d0e51b8f6b9 (diff) |
batman-adv: don't let backbone gateways exchange tt entries
As the backbone gateways are connected to the same backbone, they
should announce the same clients on the backbone non-exclusively.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r-- | net/batman-adv/translation-table.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 9648b0dc57ef..e16a3690bdb2 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "hash.h" | 27 | #include "hash.h" |
28 | #include "originator.h" | 28 | #include "originator.h" |
29 | #include "routing.h" | 29 | #include "routing.h" |
30 | #include "bridge_loop_avoidance.h" | ||
30 | 31 | ||
31 | #include <linux/crc16.h> | 32 | #include <linux/crc16.h> |
32 | 33 | ||
@@ -1615,10 +1616,15 @@ out: | |||
1615 | bool send_tt_response(struct bat_priv *bat_priv, | 1616 | bool send_tt_response(struct bat_priv *bat_priv, |
1616 | struct tt_query_packet *tt_request) | 1617 | struct tt_query_packet *tt_request) |
1617 | { | 1618 | { |
1618 | if (is_my_mac(tt_request->dst)) | 1619 | if (is_my_mac(tt_request->dst)) { |
1620 | /* don't answer backbone gws! */ | ||
1621 | if (bla_is_backbone_gw_orig(bat_priv, tt_request->src)) | ||
1622 | return true; | ||
1623 | |||
1619 | return send_my_tt_response(bat_priv, tt_request); | 1624 | return send_my_tt_response(bat_priv, tt_request); |
1620 | else | 1625 | } else { |
1621 | return send_other_tt_response(bat_priv, tt_request); | 1626 | return send_other_tt_response(bat_priv, tt_request); |
1627 | } | ||
1622 | } | 1628 | } |
1623 | 1629 | ||
1624 | static void _tt_update_changes(struct bat_priv *bat_priv, | 1630 | static void _tt_update_changes(struct bat_priv *bat_priv, |
@@ -1722,6 +1728,10 @@ void handle_tt_response(struct bat_priv *bat_priv, | |||
1722 | tt_response->src, tt_response->ttvn, tt_response->tt_data, | 1728 | tt_response->src, tt_response->ttvn, tt_response->tt_data, |
1723 | (tt_response->flags & TT_FULL_TABLE ? 'F' : '.')); | 1729 | (tt_response->flags & TT_FULL_TABLE ? 'F' : '.')); |
1724 | 1730 | ||
1731 | /* we should have never asked a backbone gw */ | ||
1732 | if (bla_is_backbone_gw_orig(bat_priv, tt_response->src)) | ||
1733 | goto out; | ||
1734 | |||
1725 | orig_node = orig_hash_find(bat_priv, tt_response->src); | 1735 | orig_node = orig_hash_find(bat_priv, tt_response->src); |
1726 | if (!orig_node) | 1736 | if (!orig_node) |
1727 | goto out; | 1737 | goto out; |
@@ -2052,6 +2062,10 @@ void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node, | |||
2052 | uint8_t orig_ttvn = (uint8_t)atomic_read(&orig_node->last_ttvn); | 2062 | uint8_t orig_ttvn = (uint8_t)atomic_read(&orig_node->last_ttvn); |
2053 | bool full_table = true; | 2063 | bool full_table = true; |
2054 | 2064 | ||
2065 | /* don't care about a backbone gateways updates. */ | ||
2066 | if (bla_is_backbone_gw_orig(bat_priv, orig_node->orig)) | ||
2067 | return; | ||
2068 | |||
2055 | /* orig table not initialised AND first diff is in the OGM OR the ttvn | 2069 | /* orig table not initialised AND first diff is in the OGM OR the ttvn |
2056 | * increased by one -> we can apply the attached changes */ | 2070 | * increased by one -> we can apply the attached changes */ |
2057 | if ((!orig_node->tt_initialised && ttvn == 1) || | 2071 | if ((!orig_node->tt_initialised && ttvn == 1) || |