fix(relay): re-insert channel into fast-path map (#6332)

This is a test-failure detected in
https://github.com/firezone/firezone/actions/runs/10426492110/job/28879531621.

In the relay, we have fast-path lookup maps to for incoming traffic from
peers. This improves throughput as any incoming packet only needs to
look-up a single routing entry. Unfortunately, this creates duplication
in how the data must be stored.

In #6276, we correctly identified that channels must be re-bound on the
relay when a client sends `CHANNEL_BIND` message whilst the channel is
cooling down. What we failed to identify (and what as now caught by the
tests) is that we also need to re-insert the entry into the fast-path
lookup map to actually allow data from flowing through the channel.
This commit is contained in:
Thomas Eizinger
2024-08-17 00:14:00 +01:00
committed by GitHub
parent 83a1e06053
commit 4750d76fce
2 changed files with 7 additions and 0 deletions

View File

@@ -83,3 +83,4 @@ cc 26e8d4724f565037da88b0363f5ee4202d2feecb4ad9ad227d806582cf81919b
cc 28c9fbe9572e61da2342347e3e5c159f3d4a62e90f3d85d6b7911fd015845656
cc ec2f348067458f6a7d3f2fbd1ab708a53fc27708440a3fcb6ed8557adc6db7d3
cc 2984b737f902f82c96ffec888a624afd7117078c125822b85de908c05f8e0b4c
cc 51ad9fe7ef585d42bd1a6369da810a5adb6d756e71aa393362e542f1560d0273

View File

@@ -672,6 +672,12 @@ where
channel.refresh(now);
// Update the fast-path map in case the binding expired in the cooldown period and got removed.
self.channel_and_client_by_port_and_peer.insert(
(channel.allocation, channel.peer_address),
(sender, requested_channel),
);
tracing::info!(target: "relay", "Refreshed channel binding");
self.send_message(