Skip to content

Fix IPv4 excludes and SOCKS5 UDP DNS handling#1

Draft
FreemanZY wants to merge 4 commits into
ymonster:mainfrom
FreemanZY:fix/ipv4-exclude-dns-udp
Draft

Fix IPv4 excludes and SOCKS5 UDP DNS handling#1
FreemanZY wants to merge 4 commits into
ymonster:mainfrom
FreemanZY:fix/ipv4-exclude-dns-udp

Conversation

@FreemanZY

Copy link
Copy Markdown

Summary

Fix three related gaps in the Windows proxy path:

  • IPv4 CIDR exclusions were parsed from configuration but were not applied consistently to TCP and UDP forwarding.
  • The SOCKS5 UDP data socket was bound to loopback, preventing DNS forwarding and ordinary UDP relay traffic from reaching a remote proxy.
  • DNS restoration preserved effective DHCP servers as static values instead of restoring the original automatic DNS mode.

Changes

  • Apply global IPv4 exclusions to automatic rules and manual hijacks, and apply process-rule exclusions to the matching rule.
  • Evaluate TCP exclusions before creating tracker entries.
  • Snapshot UDP exclusion policy at socket registration and evaluate the actual network-order destination before creating a relay session.
  • Bind SOCKS5 UDP sockets to the wildcard address and add actionable send-failure diagnostics.
  • Preserve automatic versus manual DNS configuration across forwarder enable/disable cycles.
  • Detect explicit DNS configuration through the interface NameServer registry value and reset automatic DNS with a valid empty NameServer string.
  • Add component coverage for rule priority, manual hijacks, process-tree inheritance, UDP tracking, SOCKS5 UDP relay behavior, DNS state compatibility, and automatic/manual restoration.

Validation

  • Release build completed successfully with MSBuild.
  • Component test suite: 52 passed, 0 failed.
  • Windows integration matrix: 58 passed, 0 failed across:
    • global IPv4 exclusion on/off
    • process-level IPv4 exclusion on/off
    • DNS forwarding on/off
    • TCP and UDP proxy/direct decisions
    • automatic and manual DNS restoration
  • Final integration cleanup confirmed the original configuration, effective DNS servers, and DNS mode were restored.

Risks and limitations

  • CIDR exclusion and DNS handling remain IPv4-only.
  • Existing include CIDRs and port-filter behavior are unchanged.
  • Existing TCP relay, process matching, proxy groups, and session lifecycle behavior are preserved.

@sonarqubecloud

Copy link
Copy Markdown

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