feat(gateway): bridge relay and LAN frames
The gateway now runs the actual frame bridge after relay admission. It registers the AF_PACKET socket with Tokio using AsyncFd, reads valid LAN Ethernet frames and forwards them as relay datagrams, and writes valid relay Ethernet datagrams back to the LAN socket. The packet socket is opened nonblocking so the bridge can shut down cleanly on Ctrl-C without leaving a blocking recv thread behind. Existing send_ethernet and recv_ethernet helpers now share the same validation and encoding helpers used by the bridge. This still needs a privileged LAN-host smoke test with a real wired interface, but the compile-time and loopback coverage now include the gateway relay side of the bridge and the non-root-safe packet-socket validation. Test Plan: - cargo fmt --check - cargo test --workspace - cargo clippy --workspace --all-targets -- -D warnings Refs: PLAN.md gateway AF_PACKET to relay bridge loop
This commit is contained in:
@@ -80,7 +80,7 @@ cargo run -p lanparty-gateway -- \
|
||||
--interface eth0
|
||||
```
|
||||
|
||||
The gateway currently connects to the relay as `role = gateway`, completes the
|
||||
The gateway connects to the relay as `role = gateway`, completes the
|
||||
control-stream hello/welcome handshake, opens an AF_PACKET socket on the LAN
|
||||
interface, and has relay Ethernet datagram send/receive helpers. The frame
|
||||
bridge loop is not wired yet.
|
||||
interface, and bridges Ethernet frames between the relay and wired LAN until
|
||||
shutdown.
|
||||
|
||||
Reference in New Issue
Block a user