X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=net%2Fbatman-adv%2Ftranslation-table.c;h=582f13405df9286bc752b633ed61a3b9244d545f;hb=67f4efdce7d85282fbd5832cddc80a07eb89b6d6;hp=9f5705fcf4268c5796a76c8b1302e3a6ae37c915;hpb=c53aa5058ad5ca8876a47d6639ad4d4f2c5ed584;p=firefly-linux-kernel-4.4.55.git diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 9f5705fcf426..582f13405df9 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -861,6 +861,12 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv, */ 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. @@ -1574,7 +1580,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++; @@ -2545,6 +2551,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)))