mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-24 07:28:27 +00:00
Only restart global discovery on UPnP change if it was enabled to start with (fixes #1799)
This commit is contained in:
parent
d603998617
commit
a289cfb986
@ -79,8 +79,10 @@ func (s *upnpSvc) tryIGDs(igds []upnp.IGD, prevExtPort int) int {
|
|||||||
// External port changed; refresh the discovery announcement.
|
// External port changed; refresh the discovery announcement.
|
||||||
// TODO: Don't reach out to some magic global here?
|
// TODO: Don't reach out to some magic global here?
|
||||||
l.Infof("New UPnP port mapping: external port %d to local port %d.", extPort, s.localPort)
|
l.Infof("New UPnP port mapping: external port %d to local port %d.", extPort, s.localPort)
|
||||||
discoverer.StopGlobal()
|
if s.cfg.Options().GlobalAnnEnabled {
|
||||||
discoverer.StartGlobal(s.cfg.Options().GlobalAnnServers, uint16(extPort))
|
discoverer.StopGlobal()
|
||||||
|
discoverer.StartGlobal(s.cfg.Options().GlobalAnnServers, uint16(extPort))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if debugNet {
|
if debugNet {
|
||||||
l.Debugf("Created/updated UPnP port mapping for external port %d on device %s.", extPort, igd.FriendlyIdentifier())
|
l.Debugf("Created/updated UPnP port mapping for external port %d on device %s.", extPort, igd.FriendlyIdentifier())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user