From 79745edeb07f4435e5ec4da3b15b341c9fcf2a81 Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Wed, 1 Jul 2026 16:54:52 +0100 Subject: [PATCH] tests(proto): fix description of how ManyToMany routing works (#726) ## Description The routing description didn't match the code. ## Breaking Changes none ## Notes & open questions n/a ## Change checklist - [x] Self-review. --- noq-proto/src/tests/util.rs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/noq-proto/src/tests/util.rs b/noq-proto/src/tests/util.rs index fb48a4edf..d1eaa1eac 100644 --- a/noq-proto/src/tests/util.rs +++ b/noq-proto/src/tests/util.rs @@ -1673,13 +1673,24 @@ impl BasicRouting { /// Set of uni-directional links between interfaces of a client and server. /// /// Each entry on the client or server side represents a single interface in a /32 -/// subnet. Each interface has exactly one uni-directional outgoing link to a peer -/// interface. The destination interface is identified by the `usize` index into the peer's -/// interfaces `Vec`. +/// subnet. There is at most one peer address which can send to this interface, indicated by +/// the index into the peer's interfaces. If the peer interface does not exist datagrams +/// will be dropped. If the peer sent the packet using a different source address than the +/// allowed interface the datagram will be dropped. /// -/// An interface may only appear once for a peer, so each interface only has a single -/// outgoing link. However interfaces can have multiple incoming links if multiple -/// interfaces of the peer have an outgoing link to it. +/// This implies an interface can only have one incoming link. It does allow creating +/// interface pairs that do not have bi-directional connectivity. E.g.: +/// +/// ```rust +/// ManyToManyRouting { +/// client_routes: [("[::1:1]:1", 1), ("[::1:2]:1", 1)], +/// server_routes: [("[::2:1]:1", 1), ("[::2:2]:1", 1)], +/// } +/// ``` +/// +/// This would allow the client to open up a path from `::1:2` to `::2:2`, but because a +/// path is on the 4-tuple the server would respond from `::2:2` which is not allowed to +/// send to `::1:2` and the response path would drop all datagrams. #[derive(Debug, Clone)] pub(super) struct ManyToManyRouting { client_routes: Vec<(SocketAddr, usize)>,