Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f402d73
Add Merlin 3006 dnsmasq and SDN integration
maghuro Sep 27, 2026
d4058d7
Revalidate shared Merlin hooks during cleanup
maghuro Sep 27, 2026
264088b
Revalidate shared hooks before rollback
maghuro Sep 27, 2026
3f97e77
Re-arm volatile NVRAM marker after restore failure
maghuro Sep 27, 2026
0eb072f
Scope NVRAM retry marker to Merlin
maghuro Sep 27, 2026
f058e01
Use Merlin-specific NVRAM restore retry marker
maghuro Sep 27, 2026
0c96393
Scope transactional NVRAM setup to Merlin
maghuro Sep 27, 2026
ad6acf0
Use Merlin-specific transactional NVRAM setup
maghuro Sep 27, 2026
bacef5c
Fix Merlin verifier test import
maghuro Sep 27, 2026
4659a75
Publish Merlin fallback without clobbering user config
maghuro Sep 27, 2026
9472a63
Test no-clobber Merlin fallback publication
maghuro Sep 27, 2026
4595491
Prepare Merlin snapshot ownership transactions
maghuro Sep 27, 2026
21a1531
Bind Merlin fallback ownership to publication and removal identity
maghuro Sep 27, 2026
2d38d65
Test Merlin fallback publication identity and quarantine cleanup
maghuro Sep 27, 2026
3c7deba
Add durable Merlin snapshot identity paths
maghuro Sep 27, 2026
bde9735
Journal exact Merlin fallback inode ownership
maghuro Sep 27, 2026
cf13a5e
Make Merlin fallback cleanup crash-resumable
maghuro Sep 27, 2026
4226108
Make Merlin snapshot journal parsing testable
maghuro Sep 27, 2026
7d76bcf
Test Merlin fallback journal and inode identity
maghuro Sep 27, 2026
3a78348
Revalidate and durably finalize Merlin fallback deletion
maghuro Sep 27, 2026
cdcf3b3
Test final Merlin fallback deletion revalidation
maghuro Sep 27, 2026
59db760
Validate ctrld PID ownership in Merlin DNS hook
maghuro Sep 27, 2026
661349e
Test Merlin DNS hook PID ownership validation
maghuro Sep 27, 2026
519a5d5
Fix BusyBox tr escapes in Merlin DNS hook
maghuro Sep 27, 2026
7f34700
Match Merlin DNS hook tr escape test
maghuro Sep 27, 2026
bd63d89
Fix Merlin DNS hook tr expectation
maghuro Sep 27, 2026
9348c7a
Remove obsolete Merlin snapshot helpers
maghuro Sep 27, 2026
ce1a6d7
Remove stale Merlin snapshot comment
maghuro Sep 27, 2026
d4ece38
Re-sync retried Merlin snapshot moves before journaling
maghuro Sep 27, 2026
1de6bbe
Make legacy Merlin snapshot cleanup identity-safe
maghuro Sep 27, 2026
68c3b80
Import io for legacy snapshot capture
maghuro Sep 27, 2026
e104eb4
Update legacy cleanup journal tests
maghuro Sep 27, 2026
9dc944c
Reject unjournaled legacy snapshot quarantines
maghuro Sep 27, 2026
dc7000a
Capture legacy snapshot inode identity before journaling
maghuro Sep 27, 2026
b26485f
Bind legacy cleanup to captured inode anchors
maghuro Sep 27, 2026
c56bf7b
Restore anchorless legacy quarantines safely
maghuro Sep 27, 2026
380e948
Test inode-bound legacy snapshot ownership
maghuro Sep 27, 2026
c052d08
Use POSIX paths for Merlin cleanup journals
maghuro Sep 27, 2026
5171b79
Use POSIX paths in Merlin journal tests
maghuro Sep 27, 2026
fbe9d0e
Harden Merlin state paths and dnsmasq verification
maghuro Sep 27, 2026
59f51c0
Test dnsmasq include directives fail closed
maghuro Sep 27, 2026
a83b4ec
Make Merlin mode-preservation test umask independent
maghuro Sep 27, 2026
fcd016c
Make Merlin state directory creation durable
maghuro Sep 27, 2026
cf269e2
Reconfirm Merlin state directory durability on retry
maghuro Sep 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion internal/router/dnsmasq/dnsmasq.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
MerlinJffsConfDir = "/jffs/configs"
MerlinJffsConfPath = "/jffs/configs/dnsmasq.conf"
MerlinPostConfPath = "/jffs/scripts/dnsmasq.postconf"
MerlinSdnPostConfPath = "/jffs/scripts/dnsmasq-sdn.postconf"
)

const (
Expand All @@ -47,7 +48,24 @@ config_file="$1"
. /usr/sbin/helper.sh

pid=$(cat /tmp/ctrld.pid 2>/dev/null)
if [ -n "$pid" ] && [ -f "/proc/${pid}/cmdline" ]; then
ctrld_cmd=""
case "$pid" in
''|*[!0-9]*) ;;
*)
if [ -r "/proc/${pid}/cmdline" ]; then
ctrld_cmd=$(tr '\000' '\n' < "/proc/${pid}/cmdline" 2>/dev/null | sed -n '1p')
fi
;;
esac
case "$ctrld_cmd" in
ctrld|*/ctrld)
ctrld_running=1
;;
*)
ctrld_running=0
;;
esac
if [ "$ctrld_running" -eq 1 ]; then
pc_delete "servers-file" "$config_file" # no WAN DNS settings
pc_append "no-resolv" "$config_file" # do not read /etc/resolv.conf
# use ctrld as upstream
Expand Down
Loading
Loading