feat(gateway): add relay Ethernet datagram helpers

GatewayConnection can now send and receive Ethernet frames over the admitted
relay QUIC connection. Outgoing frames are wrapped in the shared overlay format
with the gateway's assigned room id and peer id; incoming datagrams are ignored
unless they are Ethernet frames for the assigned room from another peer.

The receive helper also parses the payload as an Ethernet frame before exposing
it, which keeps the future AF_PACKET bridge from injecting malformed runt
payloads if the relay path ever misbehaves.

The loopback connector test now verifies the full post-handshake datagram path:
the gateway sends a frame to the test relay, the relay validates the overlay
metadata, and the gateway receives a relay-sent Ethernet frame back.

Test Plan:
- cargo fmt --check
- cargo test --workspace
- cargo clippy --workspace --all-targets -- -D warnings

Refs: PLAN.md gateway relay datagram send/receive
This commit is contained in:
2026-05-21 18:12:07 +02:00
parent 1b00deb419
commit 128903c312
4 changed files with 103 additions and 1 deletions
+2 -1
View File
@@ -82,4 +82,5 @@ cargo run -p lanparty-gateway -- \
The gateway currently connects to the relay as `role = gateway`, completes the
control-stream hello/welcome handshake, opens an AF_PACKET socket on the LAN
interface, and then waits for shutdown. The frame bridge loop is not wired yet.
interface, and has relay Ethernet datagram send/receive helpers. The frame
bridge loop is not wired yet.