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
This commit is contained in:
2026-05-21 19:17:17 +02:00
parent 432d1d08d1
commit 96bfbd0dbc
2 changed files with 11 additions and 2 deletions
+8
View File
@@ -185,6 +185,9 @@ fn print_pinned_relay_route(route: &PinnedRelayRoute) {
fn open_tap_adapter(session: &ClientSession) -> Result<lanparty_client_tap::TapAdapter> {
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<lanparty_client_tap::TapA
driver_mtu,
session.welcome().effective_tap_mtu()
);
println!(
"TAP interface index {} LUID {}",
tap_interface.index(),
tap_interface.luid()
);
if driver_mac != session.config().virtual_mac() {
eprintln!(
"TAP driver MAC {} does not match tunnel identity {}; MAC configuration is not wired yet",