Merge pull request #2203 from calmh/discoport

Local discovery should use the same port on v4 as v6 (fixes #2201)
This commit is contained in:
Audrius Butkevicius 2015-08-27 17:45:13 +01:00
commit 4d12df5424
3 changed files with 8 additions and 3 deletions

View File

@ -217,7 +217,7 @@ type OptionsConfiguration struct {
GlobalAnnServers []string `xml:"globalAnnounceServer" json:"globalAnnounceServers" json:"globalAnnounceServer" default:"udp4://announce.syncthing.net:22027, udp6://announce-v6.syncthing.net:22027"` GlobalAnnServers []string `xml:"globalAnnounceServer" json:"globalAnnounceServers" json:"globalAnnounceServer" default:"udp4://announce.syncthing.net:22027, udp6://announce-v6.syncthing.net:22027"`
GlobalAnnEnabled bool `xml:"globalAnnounceEnabled" json:"globalAnnounceEnabled" default:"true"` GlobalAnnEnabled bool `xml:"globalAnnounceEnabled" json:"globalAnnounceEnabled" default:"true"`
LocalAnnEnabled bool `xml:"localAnnounceEnabled" json:"localAnnounceEnabled" default:"true"` LocalAnnEnabled bool `xml:"localAnnounceEnabled" json:"localAnnounceEnabled" default:"true"`
LocalAnnPort int `xml:"localAnnouncePort" json:"localAnnouncePort" default:"21025"` LocalAnnPort int `xml:"localAnnouncePort" json:"localAnnouncePort" default:"21027"`
LocalAnnMCAddr string `xml:"localAnnounceMCAddr" json:"localAnnounceMCAddr" default:"[ff12::8384]:21027"` LocalAnnMCAddr string `xml:"localAnnounceMCAddr" json:"localAnnounceMCAddr" default:"[ff12::8384]:21027"`
RelayServers []string `xml:"relayServer" json:"relayServers" default:"dynamic+https://relays.syncthing.net"` RelayServers []string `xml:"relayServer" json:"relayServers" default:"dynamic+https://relays.syncthing.net"`
MaxSendKbps int `xml:"maxSendKbps" json:"maxSendKbps"` MaxSendKbps int `xml:"maxSendKbps" json:"maxSendKbps"`
@ -509,6 +509,11 @@ func convertV11V12(cfg *Configuration) {
cfg.Options.LocalAnnMCAddr = "[ff12::8384]:21027" cfg.Options.LocalAnnMCAddr = "[ff12::8384]:21027"
} }
// Use new local discovery port
if cfg.Options.LocalAnnPort == 21025 {
cfg.Options.LocalAnnPort = 21027
}
cfg.Version = 12 cfg.Version = 12
} }

View File

@ -35,7 +35,7 @@ func TestDefaultValues(t *testing.T) {
GlobalAnnServers: []string{"udp4://announce.syncthing.net:22027", "udp6://announce-v6.syncthing.net:22027"}, GlobalAnnServers: []string{"udp4://announce.syncthing.net:22027", "udp6://announce-v6.syncthing.net:22027"},
GlobalAnnEnabled: true, GlobalAnnEnabled: true,
LocalAnnEnabled: true, LocalAnnEnabled: true,
LocalAnnPort: 21025, LocalAnnPort: 21027,
LocalAnnMCAddr: "[ff12::8384]:21027", LocalAnnMCAddr: "[ff12::8384]:21027",
RelayServers: []string{"dynamic+https://relays.syncthing.net"}, RelayServers: []string{"dynamic+https://relays.syncthing.net"},
MaxSendKbps: 0, MaxSendKbps: 0,

View File

@ -52,7 +52,7 @@
<listenAddress>tcp://127.0.0.1:22002</listenAddress> <listenAddress>tcp://127.0.0.1:22002</listenAddress>
<globalAnnounceServer>udp4://announce.syncthing.net:22027</globalAnnounceServer> <globalAnnounceServer>udp4://announce.syncthing.net:22027</globalAnnounceServer>
<globalAnnounceServer>udp6://announce-v6.syncthing.net:22027</globalAnnounceServer> <globalAnnounceServer>udp6://announce-v6.syncthing.net:22027</globalAnnounceServer>
<globalAnnounceEnabled>false</globalAnnounceEnabled> <globalAnnounceEnabled>true</globalAnnounceEnabled>
<localAnnounceEnabled>true</localAnnounceEnabled> <localAnnounceEnabled>true</localAnnounceEnabled>
<localAnnouncePort>21025</localAnnouncePort> <localAnnouncePort>21025</localAnnouncePort>
<localAnnounceMCAddr>[ff12::8384]:21027</localAnnounceMCAddr> <localAnnounceMCAddr>[ff12::8384]:21027</localAnnounceMCAddr>