Skip to content

修复(Windows):修正faketcp回退接口并改进错误处理#208

Open
djmacdtr wants to merge 3 commits intoldoubil:mainfrom
djmacdtr:main
Open

修复(Windows):修正faketcp回退接口并改进错误处理#208
djmacdtr wants to merge 3 commits intoldoubil:mainfrom
djmacdtr:main

Conversation

@djmacdtr
Copy link

Title:
fix(windows): correct faketcp fallback interface and improve error handling

Background

在 Windows 平台上现有的 faketcp fallback 实现存在两个问题:

  • 使用的网络接口名称不准确,导致 fallback 逻辑无法触发
  • 错误信息和过滤参数不够明确,难以定位 faketcp 失败原因

这些问题造成 faketcp 功能不稳定,从而影响了在 Windows 上的连接可靠性。

Changes

  • 将 faketcp fallback 使用的 interface identifier 改为更准确的名称/匹配规则
  • 精炼并增强过滤参数逻辑,避免误判
  • 改善错误日志输出,使失败原因更清晰

Impact

仅影响 Windows 下的 faketcp fallback 实现,不会改变其它平台行为;
不影响主逻辑或核心网络引擎。

Verification

  • 在 Windows 环境中复现 faketcp fallback 失败场景
  • 确认 fallback 能正确触发并建立连接
  • 验证对应错误日志输出能反映真实失败原因

Risk

低风险,本次变更范围局部且不涉及跨平台逻辑。

Copilot AI review requested due to automatic review settings February 18, 2026 14:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments