Commit 267151cd authored by Marek Lindner's avatar Marek Lindner

batman-adv: reuse tt_len() to calculate tt buffer length

Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
Acked-by: default avatarAntonio Quartulli <ordex@autistici.org>
parent df6edb9e
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
static inline int aggregated_packet(int buff_pos, int packet_len, static inline int aggregated_packet(int buff_pos, int packet_len,
int tt_num_changes) int tt_num_changes)
{ {
int next_buff_pos = buff_pos + BAT_PACKET_LEN + (tt_num_changes * int next_buff_pos = buff_pos + BAT_PACKET_LEN + tt_len(tt_num_changes);
sizeof(struct tt_change));
return (next_buff_pos <= packet_len) && return (next_buff_pos <= packet_len) &&
(next_buff_pos <= MAX_AGGREGATION_BYTES); (next_buff_pos <= MAX_AGGREGATION_BYTES);
......
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