From af13f0cd3583590949913ab77d7d2c074dcfc83c Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Fri, 27 Nov 2020 06:34:30 +0000 Subject: [PATCH] lib/stun: Don't notify about address changes if it's not useful (fixes #7144) (#7159) --- lib/stun/stun.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/stun/stun.go b/lib/stun/stun.go index 5f53f2299..e5bb54810 100644 --- a/lib/stun/stun.go +++ b/lib/stun/stun.go @@ -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) }