Skip to content

Commit

Permalink
Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux…
Browse files Browse the repository at this point in the history
…-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 <[email protected]>
  • Loading branch information
davem330 committed Nov 16, 2012
2 parents 976a702 + 74490f9 commit 2a95388
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
12 changes: 6 additions & 6 deletions net/batman-adv/soft-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,19 +325,19 @@ void batadv_interface_rx(struct net_device *soft_iface,

soft_iface->last_rx = jiffies;

/* Let the bridge loop avoidance check the packet. If will
* not handle it, we can safely push it up.
*/
if (batadv_bla_rx(bat_priv, skb, vid, is_bcast))
goto out;

if (orig_node)
batadv_tt_add_temporary_global_entry(bat_priv, orig_node,
ethhdr->h_source);

if (batadv_is_ap_isolated(bat_priv, ethhdr->h_source, ethhdr->h_dest))
goto dropped;

/* Let the bridge loop avoidance check the packet. If will
* not handle it, we can safely push it up.
*/
if (batadv_bla_rx(bat_priv, skb, vid, is_bcast))
goto out;

netif_rx(skb);
goto out;

Expand Down
15 changes: 14 additions & 1 deletion net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,12 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv,
*/
tt_global_entry->common.flags &= ~BATADV_TT_CLIENT_TEMP;

/* the change can carry possible "attribute" flags like the
* TT_CLIENT_WIFI, therefore they have to be copied in the
* client entry
*/
tt_global_entry->common.flags |= flags;

/* If there is the BATADV_TT_CLIENT_ROAM flag set, there is only
* one originator left in the list and we previously received a
* delete + roaming change for this originator.
Expand Down Expand Up @@ -1496,7 +1502,7 @@ batadv_tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,

memcpy(tt_change->addr, tt_common_entry->addr,
ETH_ALEN);
tt_change->flags = BATADV_NO_FLAGS;
tt_change->flags = tt_common_entry->flags;

tt_count++;
tt_change++;
Expand Down Expand Up @@ -2450,6 +2456,13 @@ bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv,
{
bool ret = false;

/* if the originator is a backbone node (meaning it belongs to the same
* LAN of this node) the temporary client must not be added because to
* reach such destination the node must use the LAN instead of the mesh
*/
if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig))
goto out;

if (!batadv_tt_global_add(bat_priv, orig_node, addr,
BATADV_TT_CLIENT_TEMP,
atomic_read(&orig_node->last_ttvn)))
Expand Down

0 comments on commit 2a95388

Please sign in to comment.