Skip to content

docs(fork-prs): mark #39 decided-not-to-port - #79

Merged
fudio101 merged 1 commit into
mainfrom
docs/issue-39-close-redundant-hook
Aug 19, 2026
Merged

docs(fork-prs): mark #39 decided-not-to-port#79
fudio101 merged 1 commit into
mainfrom
docs/issue-39-close-redundant-hook

Conversation

@fudio101

Copy link
Copy Markdown
Collaborator

Summary

ip4_route_src_hook (djorr5/microlink's 67b230b2, piece (b) — piece (a) was issue #38, already landed) would force tailnet-range traffic onto the WG netif directly via LWIP_HOOK_IP4_ROUTE_SRC.

Already assessed as likely redundant in an earlier session: lwIP's own ip4_route() scans netif_list for a netmask match before ever consulting the hook, and wg_init_interface() already registers the WG netif directly into netif_list with the correct /10 netmask — so the hook's logic duplicates what already happens. The one thing left open was a possible edge case: "netif up/link-up flapping during rebind."

This session closed that gap by reading microlink_rebind() directly (microlink.c:669-730): it never touches the WG netif's link state at all — only closes/reopens the DISCO/STUN sockets and signals coord+DERP to reconnect. The netif is only ever netif_remove()'d once, in ml_wg_mgr_task's shutdown path (full microlink_stop()/destroy(), not rebind). So the netif stays continuously registered and up in netif_list for its entire lifetime outside of full teardown — the edge case the earlier assessment left open doesn't actually exist in this fork. No scenario remains where the hook would change behavior.

No code change — closing FORK_PRS.md's tracking as decided-not-to-port (distinct from "not yet done").

Test plan

N/A — documentation only, no code/build impact.

Closes #39

🤖 Generated with Claude Code

ip4_route_src_hook would force tailnet-range traffic onto the WG netif
directly. Already assessed as likely redundant (lwIP's ip4_route()
scans netif_list for a netmask match before ever consulting
LWIP_HOOK_IP4_ROUTE_SRC, and wg_init_interface() already registers the
WG netif with the correct /10 netmask) -- the one open question was a
possible edge case during microlink_rebind() netif flapping.

Re-read microlink_rebind() directly: it never touches the WG netif's
link state at all, only closes/reopens DISCO/STUN sockets and signals
coord+DERP to reconnect. The netif is only ever netif_remove()'d once,
in ml_wg_mgr_task's shutdown path (full stop/destroy, not rebind). So
the netif stays continuously up and registered for its entire lifetime
outside of full teardown -- the edge case doesn't exist. No scenario
left where the hook would change behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fudio101
fudio101 merged commit 957de74 into main Aug 19, 2026
14 checks passed
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.

Add ip4_route_src_hook for tailnet routing (mined from djorr5/microlink)

2 participants