Open
Conversation
修复了一个Bug: Windows 下 faketcp 连接失败
There was a problem hiding this comment.
Pull request overview
This PR fixes Windows-specific faketcp fallback functionality by correcting the interface identifier passed to PnetTun and improving error handling and diagnostics. The changes align the Windows implementation with the Linux and macOS patterns, where fallback to PnetTun requires a valid network interface name.
Changes:
- Changed underscore-prefixed parameters to active parameters (interface_name, src_addr) to properly pass them to the fallback implementation
- Added validation to ensure interface_name is not empty before attempting fallback
- Enhanced error messages to chain both WinDivert initialization errors and PnetTun fallback errors for better debugging
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title:
fix(windows): correct faketcp fallback interface and improve error handling
Background
在 Windows 平台上现有的 faketcp fallback 实现存在两个问题:
这些问题造成 faketcp 功能不稳定,从而影响了在 Windows 上的连接可靠性。
Changes
Impact
仅影响 Windows 下的 faketcp fallback 实现,不会改变其它平台行为;
不影响主逻辑或核心网络引擎。
Verification
Risk
低风险,本次变更范围局部且不涉及跨平台逻辑。