feat(cli): put the network state of the host in the log journal

The journal records the network state of the host and each change of
that state. The support team reads one file to see the interfaces, the
routes, the resolvers, and the recoveries around an incident. The same
file shows the health of the query path. A change that touches only
AirDrop or virtual interfaces runs no DNS work.
This commit is contained in:
Anthony Wong authored and Cuong Manh Le committed 2026-09-28 16:49:05 +07:00
1 parent 8934e09428
commit 8ae09ac98e
68 files changed
+10458 -442

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
package cli
// publishInterceptTarget mirrors the loopback DNS target that ctrld wrote into
// a network service. Callers hold interceptDNSTargetMu.
func (p *prog) publishInterceptTarget(target string) {
p.interceptTargetMirror.Store(target)
}
// interceptTargetSnapshot reads the mirrored loopback DNS target. It takes no
// lock, so a report of the network never waits on the networksetup calls that
// the target mutex covers. The value is empty while ctrld holds no service.
func (p *prog) interceptTargetSnapshot() string {
target, _ := p.interceptTargetMirror.Load().(string)
return target
}