Skip to content

Commit

Permalink
TCP: don't error on data packets with stale key id
Browse files Browse the repository at this point in the history
If we're rekeying a data packet with the old key id seems to be able to
arrive just after finishing rekeying. Or so it seems from the e2e test.
  • Loading branch information
reynir committed Sep 28, 2024
1 parent 6099a4b commit 15ba1ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/engine.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,13 @@ let incoming state control_crypto buf =
let state = { state with linger } in
let* state, out, payloads, act_opt =
match find_channel state key op with
| None -> ignore_udp_error (Error (`No_channel key))
| None -> (
match op with
| Packet.Data_v1 ->
Log.warn (fun m ->
m "ignoring packet with stale or bad key id");
Ok (state, out, payloads, act_opt)
| _ -> ignore_udp_error (Error (`No_channel key)))
| Some (ch, set_ch) -> (
Log.debug (fun m ->
m "channel %a - received key %u op %a" pp_channel ch key
Expand Down

0 comments on commit 15ba1ed

Please sign in to comment.