fix(gateway): drop unrelated LAN unicast locally
The gateway runs in promiscuous mode so it can capture frames for remote client MACs, but that also means it sees unrelated unicast traffic between physical LAN machines. Before this change those frames were sent to the public relay and only then discarded as unknown destinations. Use the remote-client table seeded by relay lifecycle events to decide whether a LAN frame should leave the gateway. Broadcast and multicast traffic still flows to the relay, and unicast to a connected remote client still flows to the relay. Unicast to any other destination is counted and logged locally as UnknownDestination. This keeps busy LAN traffic out of the relay data path and makes the gateway behavior match the MVP switching model: LAN frames go to matching remote clients, while broadcast and multicast fan out. README.md documents the local filter, and TESTING.md explains why LanToRemote UnknownDestination can be normal on a busy LAN. 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 switching model; TESTING.md MVP log signals
This commit is contained in:
@@ -201,10 +201,13 @@ frame logs include direction, peer id when present, MACs, ethertype/length,
|
||||
frame length, action, and drop reason. The gateway also tracks frame/datagram
|
||||
counters and periodically sends stats snapshots to the relay. Malformed or runt
|
||||
LAN frames are counted and logged as dropped instead of disappearing before
|
||||
accounting. Relay lifecycle events seed and retire remote-client MACs for CAM
|
||||
refresh even before that client sends traffic. On shutdown, the gateway sends a
|
||||
best-effort disconnect control message before closing QUIC so the relay can
|
||||
report the intended reason.
|
||||
accounting. It drops unrelated LAN unicast locally once the destination is known
|
||||
not to be a connected remote client, so busy LAN traffic is not sent to the
|
||||
public relay just to be discarded there. Relay lifecycle events seed and retire
|
||||
remote-client MACs for CAM refresh and LAN-destination filtering even before
|
||||
that client sends traffic. On shutdown, the gateway sends a best-effort
|
||||
disconnect control message before closing QUIC so the relay can report the
|
||||
intended reason.
|
||||
|
||||
## Windows Client
|
||||
|
||||
|
||||
Reference in New Issue
Block a user