summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Borg <jakob@kastelo.net>2023-04-19 10:40:29 +0200
committerJakob Borg <jakob@kastelo.net>2023-04-19 10:42:25 +0200
commit09efe03e1dfd64f7b925266a7d743b19ae585b06 (patch)
tree91e570272664b6b9ea96c464b62d161a50d9e600
parent0f87607cd5c75e52b6bfe8ff2c59b255e23a7c28 (diff)
lib/connections: Avoid using nil lanChecker
Otherwise it panics when someone calls Priority() on it...
-rw-r--r--lib/connections/relay_dial.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/connections/relay_dial.go b/lib/connections/relay_dial.go
index 5cb29a8cf9..d79719533f 100644
--- a/lib/connections/relay_dial.go
+++ b/lib/connections/relay_dial.go
@@ -65,6 +65,10 @@ func (d *relayDialer) Dial(ctx context.Context, id protocol.DeviceID, uri *url.U
return newInternalConn(tc, connTypeRelayClient, false, d.wanPriority), nil
}
+func (d *relayDialer) Priority(host string) int {
+ return d.wanPriority
+}
+
type relayDialerFactory struct{}
func (relayDialerFactory) New(opts config.OptionsConfiguration, tlsCfg *tls.Config, _ *registry.Registry, _ *lanChecker) genericDialer {