summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2026-06-10 23:16:18 +0200
committerSven Eckelmann <sven@narfation.org>2026-06-28 22:03:54 +0200
commit71b7987ec001a60dff689e56f4b041cfc4222c6b (patch)
treeba0f930c1fb5dbba6778e0c2de926da444f61009
parent278e5890704ceb5b93f4d13c44a640c44ed35a92 (diff)
downloadlinux-71b7987ec001a60dff689e56f4b041cfc4222c6b.tar.gz
linux-71b7987ec001a60dff689e56f4b041cfc4222c6b.zip
batman-adv: tp_meter: simplify unordered ack calculation
When batadv_tp_ack_unordered() goes through the list of unacked sequence numbers and checks for now closed gaps, it is first calculating a delta of the sequence numbers which could be acked. Just to revert this calculation in the next steps to the sequence number which would be ackable. Skip the delta step and directly work with the sequence numbers. Signed-off-by: Sven Eckelmann <sven@narfation.org>
-rw-r--r--net/batman-adv/tp_meter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
index c2eea7dbc488..b7fee6e55f03 100644
--- a/net/batman-adv/tp_meter.c
+++ b/net/batman-adv/tp_meter.c
@@ -1493,10 +1493,10 @@ static void batadv_tp_ack_unordered(struct batadv_tp_receiver *tp_vars)
if (batadv_seq_before(tp_vars->last_recv, un->seqno))
break;
- to_ack = un->seqno + un->len - tp_vars->last_recv;
+ to_ack = un->seqno + un->len;
- if (batadv_seq_before(tp_vars->last_recv, un->seqno + un->len))
- tp_vars->last_recv += to_ack;
+ if (batadv_seq_before(tp_vars->last_recv, to_ack))
+ tp_vars->last_recv = to_ack;
list_del(&un->list);
kfree(un);