aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-11-16 13:38:12 -0500
committerDavid S. Miller <davem@davemloft.net>2012-11-16 13:38:12 -0500
commit2a95388353b74a70b9c43c55a781faa92e1a14f1 (patch)
treeb1903abf4fe0fd85775a4e3ee2f14623df900f0c
parent976a702ac9eeacea09e588456ab165dc06f9ee83 (diff)
parent74490f969155caf1ec945ad2d35d3a8eec6be71d (diff)
Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge
Included fixes are: - update the client entry status flags when using the "early client detection". This makes the Distributed AP isolation correctly work; - transfer the client entry status flags when recovering the translation table from another node. This makes the Distributed AP isolation correctly work; - prevent the "early client detection mechanism" to add clients belonging to other backbone nodes in the same LAN. This breaks connectivity when using this mechanism together with the Bridge Loop Avoidance - process broadcast packets with the Bridge Loop Avoidance before any other component. BLA can possibly drop the packets based on the source address. This makes the "early client detection mechanism" correctly work when used with BLA. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/batman-adv/soft-interface.c12
-rw-r--r--net/batman-adv/translation-table.c15
2 files changed, 20 insertions, 7 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index b9a28d2dd3e8..ce0684a1fc83 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -325,6 +325,12 @@ void batadv_interface_rx(struct net_device *soft_iface,
325 325
326 soft_iface->last_rx = jiffies; 326 soft_iface->last_rx = jiffies;
327 327
328 /* Let the bridge loop avoidance check the packet. If will
329 * not handle it, we can safely push it up.
330 */
331 if (batadv_bla_rx(bat_priv, skb, vid, is_bcast))
332 goto out;
333
328 if (orig_node) 334 if (orig_node)
329 batadv_tt_add_temporary_global_entry(bat_priv, orig_node, 335 batadv_tt_add_temporary_global_entry(bat_priv, orig_node,
330 ethhdr->h_source); 336 ethhdr->h_source);
@@ -332,12 +338,6 @@ void batadv_interface_rx(struct net_device *soft_iface,
332 if (batadv_is_ap_isolated(bat_priv, ethhdr->h_source, ethhdr->h_dest)) 338 if (batadv_is_ap_isolated(bat_priv, ethhdr->h_source, ethhdr->h_dest))
333 goto dropped; 339 goto dropped;
334 340
335 /* Let the bridge loop avoidance check the packet. If will
336 * not handle it, we can safely push it up.
337 */
338 if (batadv_bla_rx(bat_priv, skb, vid, is_bcast))
339 goto out;
340
341 netif_rx(skb); 341 netif_rx(skb);
342 goto out; 342 goto out;
343 343
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 112edd371b2f..baae71585804 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -769,6 +769,12 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv,
769 */ 769 */
770 tt_global_entry->common.flags &= ~BATADV_TT_CLIENT_TEMP; 770 tt_global_entry->common.flags &= ~BATADV_TT_CLIENT_TEMP;
771 771
772 /* the change can carry possible "attribute" flags like the
773 * TT_CLIENT_WIFI, therefore they have to be copied in the
774 * client entry
775 */
776 tt_global_entry->common.flags |= flags;
777
772 /* If there is the BATADV_TT_CLIENT_ROAM flag set, there is only 778 /* If there is the BATADV_TT_CLIENT_ROAM flag set, there is only
773 * one originator left in the list and we previously received a 779 * one originator left in the list and we previously received a
774 * delete + roaming change for this originator. 780 * delete + roaming change for this originator.
@@ -1496,7 +1502,7 @@ batadv_tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,
1496 1502
1497 memcpy(tt_change->addr, tt_common_entry->addr, 1503 memcpy(tt_change->addr, tt_common_entry->addr,
1498 ETH_ALEN); 1504 ETH_ALEN);
1499 tt_change->flags = BATADV_NO_FLAGS; 1505 tt_change->flags = tt_common_entry->flags;
1500 1506
1501 tt_count++; 1507 tt_count++;
1502 tt_change++; 1508 tt_change++;
@@ -2450,6 +2456,13 @@ bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv,
2450{ 2456{
2451 bool ret = false; 2457 bool ret = false;
2452 2458
2459 /* if the originator is a backbone node (meaning it belongs to the same
2460 * LAN of this node) the temporary client must not be added because to
2461 * reach such destination the node must use the LAN instead of the mesh
2462 */
2463 if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig))
2464 goto out;
2465
2453 if (!batadv_tt_global_add(bat_priv, orig_node, addr, 2466 if (!batadv_tt_global_add(bat_priv, orig_node, addr,
2454 BATADV_TT_CLIENT_TEMP, 2467 BATADV_TT_CLIENT_TEMP,
2455 atomic_read(&orig_node->last_ttvn))) 2468 atomic_read(&orig_node->last_ttvn)))