Skip to content

Add auto redirect for Windows - #68

Draft
nekohasekai wants to merge 38 commits into
devfrom
draft-windows-auto-redirect
Draft

Add auto redirect for Windows#68
nekohasekai wants to merge 38 commits into
devfrom
draft-windows-auto-redirect

Conversation

@nekohasekai

Copy link
Copy Markdown
Member

No description provided.

Support filtering traffic by source MAC address in the prerouting chain,
using ether addr payload matching with set lookups for multiple addresses.
- Replace linearly-incremented GUIDs with independently generated ones
- Add FAST_MUTEX ConfigLock to protect Config reads/writes
- Use InterlockedCompareExchange for Running flag
- Move timer timeout processing to WDFWORKITEM (PASSIVE_LEVEL)
- Switch KSPIN_LOCK to FAST_MUTEX for PendingLock
- Switch NonPagedPool to PagedPool for PENDING_ENTRY allocations
Fix STATUS_INVALID_PARAMETER from GetBestRoute2 by passing a valid
BestSourceAddress output buffer instead of NULL.

Demote route lookup errors from fatal to permit/bypass.

Add string context to TriggerFatal so the Go side can report which
driver operation failed (GET_FATAL_INFO IOCTL).
- Remove unused routeAddressSet/routeExcludeAddressSet fields and netipx import
- Remove dead Metadata field from connEntry (already in Context)
- Remove WHAT comments per project code-comment rules
- Fix goroutine leak in connMetadataTable.cleanupLoop (add done channel)
- Cache os.Getpid() as selfPID field to avoid repeated syscalls
@nekohasekai
nekohasekai force-pushed the draft-windows-auto-redirect branch from 72bb62a to b211d06 Compare March 27, 2026 11:19
Replace the per-entry auto-bypass timeout with a fatal error that
stops the entire redirect system. Any pending entry (Queued or
Delivered) alive for 15 seconds without a verdict now triggers
TriggerFatal, surfacing the bug to userspace immediately.
- Remove unused PendingAllocate, PendingRemove, LOCAL_REDIRECT_CONTEXT
- Remove redundant ClassifyOut copy before FwpsAcquireClassifyHandle0
- Move CONFIG_SNAPSHOT out of pragma pack(1) (kernel-internal, not IPC)
- Use winsys.AF_INET constant instead of magic number
@nekohasekai
nekohasekai force-pushed the dev branch 3 times, most recently from 3900f5c to eb58efc Compare May 19, 2026 12:58
@nekohasekai
nekohasekai force-pushed the dev branch 2 times, most recently from 1d57468 to 6e76db7 Compare June 3, 2026 04:58
@nekohasekai
nekohasekai force-pushed the dev branch 2 times, most recently from d8bba36 to 54c9dbd Compare June 23, 2026 09:41
@nekohasekai
nekohasekai force-pushed the dev branch 3 times, most recently from 103bb1c to 8a2ff73 Compare July 9, 2026 14:19
@nekohasekai
nekohasekai force-pushed the dev branch 3 times, most recently from cc00f19 to e5c2107 Compare July 27, 2026 15:12
@nekohasekai
nekohasekai force-pushed the dev branch 3 times, most recently from 22b1a62 to ab72f02 Compare August 21, 2026 15:15
@nekohasekai
nekohasekai force-pushed the dev branch 3 times, most recently from d670fa3 to 98e457e Compare September 2, 2026 15:05
@nekohasekai
nekohasekai force-pushed the dev branch 9 times, most recently from 6655bc2 to 869f0a4 Compare September 12, 2026 07:55
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