mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 18:41:59 -07:00
Fix upnp mapping name
This commit is contained in:
parent
5761efdb73
commit
e4c41718d8
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user