Merge pull request #1160 from AudriusButkevicius/upnp

Use unique names for UPnP mappings (fixes #1100, fixes #1128)
This commit is contained in:
Jakob Borg 2014-12-31 12:56:47 +01:00
commit d346ec7bfe

View File

@ -795,7 +795,7 @@ func setupExternalPort(igd *upnp.IGD, port int) int {
for i := 0; i < 10; i++ {
r := 1024 + predictableRandom.Intn(65535-1024)
err := igd.AddPortMapping(upnp.TCP, r, port, "syncthing", cfg.Options().UPnPLease*60)
err := igd.AddPortMapping(upnp.TCP, r, port, fmt.Sprintf("syncthing-%d", r), cfg.Options().UPnPLease*60)
if err == nil {
return r
}