lib/stun: Don't notify about address changes if it's not useful (fixes #7144) (#7159)

This commit is contained in:
Audrius Butkevicius 2020-11-27 06:34:30 +00:00 committed by GitHub
parent e1b958284e
commit af13f0cd35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,7 +196,6 @@ func (s *Service) runStunForServer(ctx context.Context, addr string) {
}
s.setNATType(natType)
s.setExternalAddress(extAddr, addr)
l.Debugf("%s detected NAT type: %s via %s", s, natType, addr)
// We can't punch through this one, so no point doing keepalives
@ -206,6 +205,8 @@ func (s *Service) runStunForServer(ctx context.Context, addr string) {
return
}
s.setExternalAddress(extAddr, addr)
s.stunKeepAlive(ctx, addr, extAddr)
}