aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2011-10-17 08:25:13 -0400
committerMarek Lindner <lindner_marek@yahoo.de>2011-10-18 16:45:10 -0400
commit9d8523931f7f5eb8900077f0da0fbe6b8ad0010b (patch)
treeddd0a5bdab79ec62b7c5b3464f77e247ace0c8af /net
parent31901264511cf20c5ed33b8649a3ca9ce28df60b (diff)
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>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/translation-table.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index f599db9dbec..ef1acfd7653 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -999,7 +999,6 @@ static struct sk_buff *tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,
999 tt_response = (struct tt_query_packet *)skb_put(skb, 999 tt_response = (struct tt_query_packet *)skb_put(skb,
1000 tt_query_size + tt_len); 1000 tt_query_size + tt_len);
1001 tt_response->ttvn = ttvn; 1001 tt_response->ttvn = ttvn;
1002 tt_response->tt_data = htons(tt_tot);
1003 1002
1004 tt_change = (struct tt_change *)(skb->data + tt_query_size); 1003 tt_change = (struct tt_change *)(skb->data + tt_query_size);
1005 tt_count = 0; 1004 tt_count = 0;
@@ -1025,6 +1024,10 @@ static struct sk_buff *tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,
1025 } 1024 }
1026 rcu_read_unlock(); 1025 rcu_read_unlock();
1027 1026
1027 /* store in the message the number of entries we have successfully
1028 * copied */
1029 tt_response->tt_data = htons(tt_count);
1030
1028out: 1031out:
1029 return skb; 1032 return skb;
1030} 1033}