Commit 437bb0e6 authored by Simon Wunderlich's avatar Simon Wunderlich Committed by Antonio Quartulli

batman-adv: fix speedy join for DAT cache replies

DAT Cache replies are answered on behalf of other clients which are not
connected to the answering originator. Therefore, we shouldn't add these
clients to the answering originators TT table through speed join to
avoid bogus entries.
Reported-by: default avatarAlessandro Bolletta <alessandro@mediaspot.net>
Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
Acked-by: default avatarAntonio Quartulli <antonio@meshcoding.com>
Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: default avatarAntonio Quartulli <antonio@meshcoding.com>
parent 326fcfa5
...@@ -836,6 +836,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, ...@@ -836,6 +836,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
u8 *orig_addr; u8 *orig_addr;
struct batadv_orig_node *orig_node = NULL; struct batadv_orig_node *orig_node = NULL;
int check, hdr_size = sizeof(*unicast_packet); int check, hdr_size = sizeof(*unicast_packet);
enum batadv_subtype subtype;
bool is4addr; bool is4addr;
unicast_packet = (struct batadv_unicast_packet *)skb->data; unicast_packet = (struct batadv_unicast_packet *)skb->data;
...@@ -863,10 +864,20 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, ...@@ -863,10 +864,20 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
/* packet for me */ /* packet for me */
if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) { if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
if (is4addr) { if (is4addr) {
batadv_dat_inc_counter(bat_priv, subtype = unicast_4addr_packet->subtype;
unicast_4addr_packet->subtype); batadv_dat_inc_counter(bat_priv, subtype);
orig_addr = unicast_4addr_packet->src;
orig_node = batadv_orig_hash_find(bat_priv, orig_addr); /* Only payload data should be considered for speedy
* join. For example, DAT also uses unicast 4addr
* types, but those packets should not be considered
* for speedy join, since the clients do not actually
* reside at the sending originator.
*/
if (subtype == BATADV_P_DATA) {
orig_addr = unicast_4addr_packet->src;
orig_node = batadv_orig_hash_find(bat_priv,
orig_addr);
}
} }
if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb, if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment