From 96bfbd0dbcfa4a4db453c473e6f3ac6d71fd9ae0 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Thu, 21 May 2026 19:17:17 +0200 Subject: [PATCH] feat(client): report TAP interface identity Resolve the opened TAP adapter's NetCfgInstanceId to its Windows interface index and LUID during startup, then print those values with the existing TAP MAC/MTU diagnostics. This makes the interface identity visible before the next metric-setting slice uses it for route protection. The lookup failure is treated as startup failure because an opened TAP adapter that cannot be resolved as a Windows network interface is not a good candidate for metric or route management. Verification note: I attempted to check `lanparty-client-win` for `x86_64-pc-windows-msvc`, but this host still lacks the Windows C headers needed by `ring`; the build stops at `assert.h` before the binary crate can be typechecked for Windows. Test Plan: - cargo fmt --check - cargo test --workspace - cargo clippy --workspace --all-targets -- -D warnings - cargo check -p lanparty-client-route --target x86_64-pc-windows-msvc - cargo clippy -p lanparty-client-route --target x86_64-pc-windows-msvc --all-targets -- -D warnings - git diff --check Refs: PLAN.md --- README.md | 5 +++-- crates/lanparty-client-win/src/main.rs | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 52f2287..ad36939 100644 --- a/README.md +++ b/README.md @@ -137,5 +137,6 @@ and then bridges Ethernet frames between the relay and the first TAP-Windows6 adapter until shutdown. `--virtual-mac` can still override the stored identity for manual testing. On Windows it marks the TAP media connected and reports the driver MAC/MTU before -forwarding frames. Default-route takeover neutralization and automatic TAP -MAC/MTU configuration are not wired yet. +forwarding frames, along with the TAP interface index/LUID. Default-route +takeover neutralization and automatic TAP MAC/MTU configuration are not wired +yet. diff --git a/crates/lanparty-client-win/src/main.rs b/crates/lanparty-client-win/src/main.rs index 012d20d..baca39d 100644 --- a/crates/lanparty-client-win/src/main.rs +++ b/crates/lanparty-client-win/src/main.rs @@ -185,6 +185,9 @@ fn print_pinned_relay_route(route: &PinnedRelayRoute) { fn open_tap_adapter(session: &ClientSession) -> Result { let tap = lanparty_client_tap::open_first_adapter()?; tap.set_media_connected(true)?; + let tap_interface = + lanparty_client_route::interface_identity_from_guid(tap.info().instance_id()) + .context("failed to resolve TAP interface identity")?; let driver_mac = tap.driver_mac()?; let driver_mtu = tap.driver_mtu()?; @@ -198,6 +201,11 @@ fn open_tap_adapter(session: &ClientSession) -> Result