summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2016-06-26 10:17:12 +0000
committerJakob Borg <jakob@nym.se>2016-06-26 10:17:12 +0000
commita2dcffcca2f425d84ca45a1e7f4a67cc785cb65d (patch)
tree19c3b4587e6f349cf7086a77e13f017741142cbf
parent9323f0faf83316963c50c180490d34284b28fc0c (diff)
lib/nat: Avoid concurrent reset of NAT timer (fixes #3337)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3341
-rw-r--r--lib/nat/service.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/nat/service.go b/lib/nat/service.go
index ad14e2945..a04ea78bf 100644
--- a/lib/nat/service.go
+++ b/lib/nat/service.go
@@ -44,9 +44,8 @@ func NewService(id protocol.DeviceID, cfg *config.Wrapper) *Service {
func (s *Service) Serve() {
announce := stdsync.Once{}
- s.timer.Reset(0)
-
s.mut.Lock()
+ s.timer.Reset(0)
s.stop = make(chan struct{})
s.mut.Unlock()