Skip to content

[v1.x] Use Merlin DNS hooks for main and SDN dnsmasq - #7

Merged
maghuro merged 13 commits into
v1.0from
fix/v1-merlin-dnsmasq-hooks
Sep 27, 2026
Merged

maghuro merged 13 commits into
v1.0from
fix/v1-merlin-dnsmasq-hooks

Conversation

@maghuro

@maghuro maghuro commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Important

Local staging/review draft in the fork only. Upstream contribution guidelines require an issue before any PR.

Stacked on #6 and targeted at the maintained v1.x router-support line. This is the v1.x port of #2.

Summary

Replace the fragile Merlin full-config snapshot model with supported main/SDN hooks and Guest Network Pro handling.

  • install ctrld-managed blocks into both dnsmasq.postconf and Merlin 3006 dnsmasq-sdn.postconf;
  • verify generated main and SDN dnsmasq configuration after restart;
  • fail closed when unresolved conf-file=, conf-dir= or conf-script= includes are present;
  • keep a compatibility fallback for main dnsmasq only when the supported hook demonstrably did not apply;
  • never create full dnsmasq-N.conf SDN snapshots;
  • make NVRAM setup/restore retry-aware only for Merlin;
  • ensure the private Merlin state directory exists and its parent-directory entry is durably synced before state is trusted;
  • migrate legacy ctrld snapshots with crash-safe inode-aware journaling, private hard-link ownership anchors and conservative restoration;
  • protect main fallback publication/cleanup with no-clobber and inode/content revalidation;
  • validate stale PID files against the actual ctrld process;
  • preserve unrelated shared-hook content and roll back partial hook writes.

Port parity

internal/router/merlin/merlin.go, its regression tests, and internal/router/nvram/nvram.go now match the final #2 implementation. The intentional v1.x difference is that internal/router/dnsmasq/dnsmasq.go retains text/template instead of the unrelated main-branch html/template change.

Related

Control-D-Inc#229

@maghuro
maghuro changed the base branch from fix/v1-merlin-postconf-coexistence to v1.0 September 27, 2026 20:20

maghuro commented Sep 27, 2026

Copy link
Copy Markdown
Owner Author

v1.x parity update:

CI on the pre-base-alignment tree passed Ubuntu, macOS and Windows. The current merge-only head is being revalidated by CI.

@maghuro
maghuro marked this pull request as ready for review September 27, 2026 20:23
@maghuro
maghuro merged commit 597e934 into v1.0 Sep 27, 2026
3 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.

1 participant