Skip to content

Commit 17ce753

Browse files
committed
wgengine: adjust debug logging for WireGuard-only peers
Updates #cleanup Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
1 parent 1a64166 commit 17ce753

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

wgengine/pendopen.go

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,15 @@ func (e *userspaceEngine) onOpenTimeout(flow flowtrack.Tuple) {
146146
return
147147
}
148148
n := pip.Node
149-
if n.DiscoKey.IsZero() {
150-
e.logf("open-conn-track: timeout opening %v; peer node %v running pre-0.100", flow, n.Key.ShortString())
151-
return
152-
}
153-
if n.DERP == "" {
154-
e.logf("open-conn-track: timeout opening %v; peer node %v not connected to any DERP relay", flow, n.Key.ShortString())
155-
return
149+
if !n.IsWireGuardOnly {
150+
if n.DiscoKey.IsZero() {
151+
e.logf("open-conn-track: timeout opening %v; peer node %v running pre-0.100", flow, n.Key.ShortString())
152+
return
153+
}
154+
if n.DERP == "" {
155+
e.logf("open-conn-track: timeout opening %v; peer node %v not connected to any DERP relay", flow, n.Key.ShortString())
156+
return
157+
}
156158
}
157159

158160
ps, found := e.getPeerStatusLite(n.Key)
@@ -187,15 +189,19 @@ func (e *userspaceEngine) onOpenTimeout(flow flowtrack.Tuple) {
187189
_ = ps.LastHandshake
188190

189191
online := "?"
190-
if n.Online != nil {
191-
if *n.Online {
192-
online = "yes"
193-
} else {
194-
online = "no"
192+
if n.IsWireGuardOnly {
193+
online = "wg"
194+
} else {
195+
if n.Online != nil {
196+
if *n.Online {
197+
online = "yes"
198+
} else {
199+
online = "no"
200+
}
201+
}
202+
if n.LastSeen != nil && online != "yes" {
203+
online += fmt.Sprintf(", lastseen=%v", durFmt(*n.LastSeen))
195204
}
196-
}
197-
if n.LastSeen != nil && online != "yes" {
198-
online += fmt.Sprintf(", lastseen=%v", durFmt(*n.LastSeen))
199205
}
200206
e.logf("open-conn-track: timeout opening %v to node %v; online=%v, lastRecv=%v",
201207
flow, n.Key.ShortString(),

0 commit comments

Comments
 (0)