Skip to content

Commit

Permalink
batman-adv: reuse tt_len() to calculate tt buffer length
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Acked-by: Antonio Quartulli <ordex@autistici.org>
  • Loading branch information
Marek Lindner committed Aug 22, 2011
1 parent df6edb9 commit 267151c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/batman-adv/aggregation.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
static inline int aggregated_packet(int buff_pos, int packet_len,
int tt_num_changes)
{
int next_buff_pos = buff_pos + BAT_PACKET_LEN + (tt_num_changes *
sizeof(struct tt_change));
int next_buff_pos = buff_pos + BAT_PACKET_LEN + tt_len(tt_num_changes);

return (next_buff_pos <= packet_len) &&
(next_buff_pos <= MAX_AGGREGATION_BYTES);
Expand Down

0 comments on commit 267151c

Please sign in to comment.