Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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

parent df6edb9e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);