fix(gateway): filter remote frames before LAN injection
The relay already filters unsafe remote-client traffic, but the gateway is the last process before the physical LAN. Treating a relayed Ethernet frame as safe just because it came from the relay leaves the LAN boundary dependent on one upstream check. Add a gateway-local remote-to-LAN safety decision before AF_PACKET writes. The gateway now skips and logs relayed frames with invalid source MACs, L2 control traffic, remote VLAN tags, DHCP-server replies, IPv6 Router Advertisements, IPv6 fragments, or jumbo payloads. The public receive helper also loops past filtered frames so callers only receive frames that can be injected. Document the final gateway boundary check in the README and extend the gateway relay integration test so an unsafe relayed frame is filtered before the valid frame is delivered. Test Plan: - cargo test -p lanparty-gateway - cargo test --workspace - cargo clippy --workspace --all-targets -- -D warnings - cargo fmt --check - git diff --check Refs: PLAN.md remote-to-LAN safety filters
This commit is contained in:
@@ -181,7 +181,11 @@ overlay payload-length ceiling before deciding whether they fit the tunnel. It
|
||||
never fragments Ethernet frames; LAN frames with invalid source MACs, L2
|
||||
control-plane traffic, jumbo frames, or encoded datagrams exceeding the
|
||||
negotiated QUIC budget are counted, dropped, and logged locally instead of
|
||||
stopping the bridge or consuming relay bandwidth.
|
||||
stopping the bridge or consuming relay bandwidth. Remote frames received from
|
||||
the relay are safety-checked again before LAN injection, so invalid-source,
|
||||
L2 control-plane, remote VLAN, DHCP-server, IPv6 Router Advertisement, IPv6
|
||||
fragment, and jumbo frames cannot cross the gateway's final physical-LAN
|
||||
boundary even if they reached the gateway over QUIC.
|
||||
`--relay` accepts a DNS name or socket address; bare hosts default to UDP/443.
|
||||
The gateway rejects Linux interfaces that sysfs identifies as Wi-Fi, and rejects
|
||||
wired interfaces whose sysfs carrier state reports no link; managed wireless
|
||||
|
||||
Reference in New Issue
Block a user