add Windows TAP support#14
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces Windows support for EtherGuard, adding Windows TAP adapter management using the water library and registry/netsh configurations, alongside Windows Registered I/O (RIO) socket binding support. The review feedback highlights two important robustness issues: a PowerShell compatibility bug on Windows 7 regarding Start-Sleep -Milliseconds and potential script errors when disabling/enabling adapters, and a potential failure when configuring IPv6 MTU on systems where IPv6 is globally disabled.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
51d884b to
db174ee
Compare
|
CI note: GitHub created the latest Go workflow run for commit db174ee, but it is currently marked |
|
/gemini review again |
There was a problem hiding this comment.
Code Review
This pull request introduces Windows TAP adapter support using the "github.com/songgao/water" library, refactors network binding to support selective IPv4/IPv6 address families, and adds comprehensive unit tests. The review feedback suggests implementing a retry mechanism in "WinRingBind.Open" for dual-stack configurations when binding to port 0 to prevent intermittent failures, and treating errors in the TAP status monitoring loop as the interface being down to ensure correct event propagation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
db174ee to
868ae82
Compare
868ae82 to
6fb2545
Compare
|
/gemini review again |
There was a problem hiding this comment.
Code Review
This pull request introduces Windows support to EtherGuard, implementing a Windows TAP device using TAP-Windows6 and adding Windows Registered I/O (RIO) socket binding. It also refactors socket binding across platforms to use shared address parsing logic and updates various dependencies. The review feedback highlights a critical boundary check issue in the Windows TAP device's Read and Write methods, where an offset equal to the buffer length could trigger invalid zero-byte operations instead of returning an error.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
6fb2545 to
8ca2533
Compare
Summary
NewDefaultBindAPI, including standard UDP fallback when RIO is unavailabletap.DeviceinterfaceThis addresses #4 and #10. The repository's previous pull requests did not contain a reusable Windows implementation.
Compatibility
-bind stdWintun is intentionally not used because EtherGuard transports Ethernet frames and requires a layer-2 adapter.
Review hardening
closesocketbefore freeing request queues and registered buffers, propagate teardown errors, and cover repeated fixed-port reopenVerification
Current #15-based head:
go test ./..., build,-version, real TAP integration, and real RIO open/close/reopengo test ./...andgo test -race ./...GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go test -exec=/usr/bin/true ./...GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go buildactionlintfor both modified workflowsLegacy pre-#15 baseline:
The real TAP tests use private KVM VMs and are intentionally separate from GitHub-hosted runners, which do not install a kernel TAP driver. The current hosted workflow run is pending maintainer approval for a first-time external contributor.