Skip to content

Commit 0ba23a2

Browse files
Yossef Efraimklassert
authored andcommitted
xfrm: Fix xfrm_replay_overflow_offload_esn
In case of wrap around, replay_esn->oseq_hi is not updated before it is tested for it's actual value, leading function to fail with overflow indication and packets being dropped. This patch updates replay_esn->oseq_hi in the right place. Fixes: d7dbefc ("xfrm: Add xfrm_replay_overflow functions for offloading") Signed-off-by: Yossef Efraim <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 5c0bb26 commit 0ba23a2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/xfrm/xfrm_replay.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ static int xfrm_replay_overflow_offload_esn(struct xfrm_state *x, struct sk_buff
666666
if (unlikely(oseq < replay_esn->oseq)) {
667667
XFRM_SKB_CB(skb)->seq.output.hi = ++oseq_hi;
668668
xo->seq.hi = oseq_hi;
669-
669+
replay_esn->oseq_hi = oseq_hi;
670670
if (replay_esn->oseq_hi == 0) {
671671
replay_esn->oseq--;
672672
replay_esn->oseq_hi--;
@@ -678,7 +678,6 @@ static int xfrm_replay_overflow_offload_esn(struct xfrm_state *x, struct sk_buff
678678
}
679679

680680
replay_esn->oseq = oseq;
681-
replay_esn->oseq_hi = oseq_hi;
682681

683682
if (xfrm_aevent_is_on(net))
684683
x->repl->notify(x, XFRM_REPLAY_UPDATE);

0 commit comments

Comments
 (0)