summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2026-06-26 18:11:15 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-04 13:42:23 +0200
commitedae04afb11f6a1213033bcdcdfea93870c91619 (patch)
tree1bc76fa9d1da78a2ff5b4fe173374682ca683d51
parentbc6c380c1159de52a252ed11f19a42c47f60a735 (diff)
downloadlinux-stable-edae04afb11f6a1213033bcdcdfea93870c91619.tar.gz
linux-stable-edae04afb11f6a1213033bcdcdfea93870c91619.zip
batman-adv: tp_meter: keep unacked list in ascending ordered
commit 5aa8651527ea0b610e7a09fb3b8204c1398b9525 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: 33a3bb4a3345 ("batman-adv: throughput meter implementation") Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/batman-adv/tp_meter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
index dfc337454992..f350a60e6c76 100644
--- a/net/batman-adv/tp_meter.c
+++ b/net/batman-adv/tp_meter.c
@@ -1325,7 +1325,7 @@ static bool batadv_tp_handle_out_of_order(struct batadv_tp_vars *tp_vars,
* one is attached _after_ it. In this way the list is kept in
* ascending order
*/
- list_add_tail(&new->list, &un->list);
+ list_add(&new->list, &un->list);
added = true;
break;
}