Skip to content

Commit 9d85239

Browse files
Antonio QuartulliMarek Lindner
authored andcommitted
batman-adv: correctly set the data field in the TT_REPONSE packet
In the TT_RESPONSE packet, the number of carried entries is not correctly set. This leads to a wrong interpretation of the packet payload on the receiver side causing random entries to be added to the global translation table. Therefore the latter gets always corrupted, triggering a table recovery all the time. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
1 parent 3190126 commit 9d85239

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎net/batman-adv/translation-table.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,6 @@ static struct sk_buff *tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,
999999
tt_response = (struct tt_query_packet *)skb_put(skb,
10001000
tt_query_size + tt_len);
10011001
tt_response->ttvn = ttvn;
1002-
tt_response->tt_data = htons(tt_tot);
10031002

10041003
tt_change = (struct tt_change *)(skb->data + tt_query_size);
10051004
tt_count = 0;
@@ -1025,6 +1024,10 @@ static struct sk_buff *tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,
10251024
}
10261025
rcu_read_unlock();
10271026

1027+
/* store in the message the number of entries we have successfully
1028+
* copied */
1029+
tt_response->tt_data = htons(tt_count);
1030+
10281031
out:
10291032
return skb;
10301033
}

0 commit comments

Comments
 (0)