TUN inbound: Consolidate files and remove unneeded tests; Rename wfp_leak.go to wfp_block.go

As requested in https://github.com/XTLS/Xray-core/pull/7460#issuecomment-7131171930:
proxy/tun goes from 36 files to 29. No behaviour change: the merged code is
moved as it is.

Merged:
- guid.go into config.go
- tun_windows_outbound.go into tun_windows.go
- tun_windows_wfp_test.go and guid_windows_test.go into tun_windows_test.go
- tun_freebsd_dns_test.go into tun_freebsd_test.go
- tun_linux_dns_test.go and tun_linux_dns_route_test.go into tun_linux_test.go

Renamed wfp_leak.go and wfp_leak_test.go to wfp_block.go and wfp_block_test.go.

Removed:
- guid_test.go: TestTunConfigGUID in infra/conf covers what ParseGUID accepts,
  and TestAdapterGUID the bytes it returns. The one case they lacked, a hyphen
  out of place, is now in TestTunConfigGUID.
- TestLeakCovers: covers is only ever asked about port 53, which
  TestExpandWfpBlockLeak checks through BlocksSystemDNS.
- udp_queue_bench_test.go and BenchmarkUDPNewSession: benchmarks, which CI
  does not run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
patterniha
2026-11-25 18:25:44 +09:00
co-authored by Claude Opus 5.5
parent 5d8b20239f
commit ab3c3f9909
16 changed files with 743 additions and 979 deletions
+1
View File
@@ -159,6 +159,7 @@ func TestTunConfigGUID(t *testing.T) {
for _, guid := range []string{
"xray0",
"6ba7b810-9dad-11d1-80b4-00c04fd430c",
"6ba7b8109-dad-11d1-80b4-00c04fd430c8", // the right length, a hyphen out of place
"6ba7b8109dad11d180b400c04fd430c8",
"{6ba7b810-9dad-11d1-80b4-00c04fd430c8}",
"urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8",