Fix upnp mapping name

This commit is contained in:
Jakob Borg 2015-05-09 20:04:15 +02:00
parent 5761efdb73
commit e4c41718d8

View File

@ -100,7 +100,7 @@ func (s *upnpSvc) tryIGD(igd upnp.IGD, suggestedPort int) (int, error) {
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
// Then try up to ten random ports. // Then try up to ten random ports.
extPort := 1024 + predictableRandom.Intn(65535-1024) 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) err = igd.AddPortMapping(upnp.TCP, extPort, s.localPort, name, leaseTime)
if err == nil { if err == nil {
return extPort, nil return extPort, nil