lib/connections: Silence "connected to myself" messages. (#7500)

This commit is contained in:
Audrius Butkevicius
2021-03-17 23:53:20 +01:00
committed by GitHub
parent fdd823d2cb
commit 4b02b7e6f1
+2 -2
View File
@@ -244,7 +244,7 @@ func (s *service) handle(ctx context.Context) error {
// though, especially in the presence of NAT hairpinning, multiple
// clients between the same NAT gateway, and global discovery.
if remoteID == s.myID {
l.Infof("Connected to myself (%s) at %s - should not happen", remoteID, c)
l.Debugf("Connected to myself (%s) at %s", remoteID, c)
c.Close()
continue
}
@@ -1023,7 +1023,7 @@ func (s *service) validateIdentity(c internalConn, expectedID protocol.DeviceID)
// though, especially in the presence of NAT hairpinning, multiple
// clients between the same NAT gateway, and global discovery.
if remoteID == s.myID {
l.Infof("Connected to myself (%s) at %s - should not happen", remoteID, c)
l.Debugf("Connected to myself (%s) at %s", remoteID, c)
c.Close()
return errors.New("connected to self")
}