Skip to content

Commit 1c5a126

Browse files
ecsvgregkh
authored andcommitted
batman-adv: tp_meter: keep unacked list in ascending ordered
commit 5aa8651 upstream. When batadv_tp_handle_out_of_order inserts a new entry in the list of unacked (out of order) packets, it searches from the entry with the newest sequence number towards oldest sequence number. If an entry is found which is older than the newly entry, the new entry has to be added after the found one to keep the ascending order. But for this operation list_add_tail() was used. But this function adds an entry _before_ another one. As result, the list would contain a lot of swapped sequence numbers. The consumer of this list (batadv_tp_ack_unordered()) would then fail to correctly ack packets. Cc: stable@kernel.org Fixes: 33a3bb4 ("batman-adv: throughput meter implementation") Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e055e74 commit 1c5a126

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/batman-adv/tp_meter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ static bool batadv_tp_handle_out_of_order(struct batadv_tp_vars *tp_vars,
13251325
* one is attached _after_ it. In this way the list is kept in
13261326
* ascending order
13271327
*/
1328-
list_add_tail(&new->list, &un->list);
1328+
list_add(&new->list, &un->list);
13291329
added = true;
13301330
break;
13311331
}

0 commit comments

Comments
 (0)