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

This commit is contained in:
Audrius Butkevicius 2021-03-17 22:53:20 +00:00 committed by GitHub
parent fdd823d2cb
commit 4b02b7e6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

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")
}