Commit 2a95388353b74a70b9c43c55a781faa92e1a14f1

Authored by David S. Miller

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>

Showing 2 changed files Side-by-side Diff

net/batman-adv/soft-interface.c
... ... @@ -325,18 +325,18 @@
325 325  
326 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 334 if (orig_node)
329 335 batadv_tt_add_temporary_global_entry(bat_priv, orig_node,
330 336 ethhdr->h_source);
331 337  
332 338 if (batadv_is_ap_isolated(bat_priv, ethhdr->h_source, ethhdr->h_dest))
333 339 goto dropped;
334   -
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 340  
341 341 netif_rx(skb);
342 342 goto out;
net/batman-adv/translation-table.c
... ... @@ -769,6 +769,12 @@
769 769 */
770 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 778 /* If there is the BATADV_TT_CLIENT_ROAM flag set, there is only
773 779 * one originator left in the list and we previously received a
774 780 * delete + roaming change for this originator.
... ... @@ -1496,7 +1502,7 @@
1496 1502  
1497 1503 memcpy(tt_change->addr, tt_common_entry->addr,
1498 1504 ETH_ALEN);
1499   - tt_change->flags = BATADV_NO_FLAGS;
  1505 + tt_change->flags = tt_common_entry->flags;
1500 1506  
1501 1507 tt_count++;
1502 1508 tt_change++;
... ... @@ -2449,6 +2455,13 @@
2449 2455 const unsigned char *addr)
2450 2456 {
2451 2457 bool ret = false;
  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;
2452 2465  
2453 2466 if (!batadv_tt_global_add(bat_priv, orig_node, addr,
2454 2467 BATADV_TT_CLIENT_TEMP,