Audit changes.

This commit is contained in:
jdl
2026-06-13 19:34:18 +02:00
parent c325180a1b
commit 2e19f0945f

View File

@@ -117,22 +117,24 @@ func (a *App) onShutdown() error {
func (a *App) logNetworkState() {
var b strings.Builder
fmt.Fprintf(&b, "Network state (self: %s public=%v):\n", a.vpnIP, a.isPublic)
fmt.Fprintf(&b, " Network: %v", a.vpnNet)
fmt.Fprintf(&b, " IPv4: %v\n", a.selfV4)
fmt.Fprintf(&b, " IPv6: %v\n", a.selfV6)
b.WriteString("Peers:\n")
for _, p := range a.peersByIP {
ip := p.VPNIP.As4()[3]
switch p.State {
case StateDirect:
fmt.Fprintf(&b, " %24s %s DIRECT @ %s rtt=%s\n",
p.Name, p.VPNIP, p.WGEndpoint(), p.RTT.Round(time.Millisecond))
fmt.Fprintf(&b, " %24s %03d DIRECT @ %s rtt=%s\n",
p.Name, ip, p.WGEndpoint(), p.RTT.Round(time.Millisecond))
case StateProbing:
fmt.Fprintf(&b, " %24s %s PROBING @ %s\n",
p.Name, p.VPNIP, p.PreferredEndpoint())
fmt.Fprintf(&b, " %24s %03d PROBING @ %s\n",
p.Name, ip, p.PreferredEndpoint())
case StateRelayed:
fmt.Fprintf(&b, " %24s %s RELAYED\n", p.Name, p.VPNIP)
fmt.Fprintf(&b, " %24s %03d RELAYED\n", p.Name, ip)
}
}
log.Print(b.String())