From 01ade9c8aededf3aa07f3be9bf5ceaa7072013b4 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Tue, 30 Oct 2018 10:34:19 +0100 Subject: [PATCH] lib/connections: Don't panic on removed device (fixes #5299) (#5300) --- lib/connections/service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/connections/service.go b/lib/connections/service.go index 0f656374..6d6426d3 100644 --- a/lib/connections/service.go +++ b/lib/connections/service.go @@ -245,7 +245,9 @@ next: deviceCfg, ok := s.cfg.Device(remoteID) if !ok { - panic("bug: unknown device should already have been rejected") + l.Infof("Device %s removed from config during connection attempt at %s", remoteID, c) + c.Close() + continue } // Verify the name on the certificate. By default we set it to