If a TT_Request is directed to a node and it fails in handling it (e.g. it does not know the source node yet), the node will print a "re-routing" message and will try to forward the packet. However it will fails because the destination is itself. To avoid this misbehaviour, the node has to never try to re-route a packet directed to it.
Signed-off-by: Antonio Quartulli ordex@autistici.org --- translation-table.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/translation-table.c b/translation-table.c index 2a6d7d6..9eb45c8 100644 --- a/translation-table.c +++ b/translation-table.c @@ -1648,7 +1648,7 @@ out:
}
-static bool +static void batadv_send_my_tt_response(struct batadv_priv *bat_priv, struct batadv_tt_query_packet *tt_request) { @@ -1656,7 +1656,6 @@ batadv_send_my_tt_response(struct batadv_priv *bat_priv, struct batadv_neigh_node *neigh_node = NULL; struct batadv_hard_iface *primary_if = NULL; uint8_t my_ttvn, req_ttvn, ttvn; - int ret = false; unsigned char *tt_buff; bool full_table; uint16_t tt_len, tt_tot; @@ -1751,7 +1750,6 @@ batadv_send_my_tt_response(struct batadv_priv *bat_priv, batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_TX);
batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr); - ret = true; goto out;
unlock: @@ -1763,10 +1761,6 @@ out: batadv_neigh_node_free_ref(neigh_node); if (primary_if) batadv_hardif_free_ref(primary_if); - if (!ret) - kfree_skb(skb); - /* This packet was for me, so it doesn't need to be re-routed */ - return true; }
bool batadv_send_tt_response(struct batadv_priv *bat_priv, @@ -1777,7 +1771,9 @@ bool batadv_send_tt_response(struct batadv_priv *bat_priv, if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_request->src)) return true;
- return batadv_send_my_tt_response(bat_priv, tt_request); + batadv_send_my_tt_response(bat_priv, tt_request); + /* This packet was for me, so it never needs to be re-routed */ + return true; } else { return batadv_send_other_tt_response(bat_priv, tt_request); }