diff --git a/cmd/syncthing/upnpsvc.go b/cmd/syncthing/upnpsvc.go index df71a69bd..52f98cd19 100644 --- a/cmd/syncthing/upnpsvc.go +++ b/cmd/syncthing/upnpsvc.go @@ -100,7 +100,7 @@ func (s *upnpSvc) tryIGD(igd upnp.IGD, suggestedPort int) (int, error) { for i := 0; i < 10; i++ { // Then try up to ten random ports. extPort := 1024 + predictableRandom.Intn(65535-1024) - name := fmt.Sprintf("syncthing-%d", suggestedPort) + name := fmt.Sprintf("syncthing-%d", extPort) err = igd.AddPortMapping(upnp.TCP, extPort, s.localPort, name, leaseTime) if err == nil { return extPort, nil