Go CLI work

This commit is contained in:
Adam Ierymenko 2019-09-24 12:19:28 -07:00
commit f4a5abeed9
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
7 changed files with 154 additions and 10 deletions

View file

@ -47,11 +47,11 @@ type LocalConfigSettings struct {
// TertiaryPort is a third UDP port, set to 0 to disable (picked at random by default)
TertiaryPort int
// PortAutoSearch causes ZeroTier to try other ports automatically if it can't bind to configured ports
PortAutoSearch bool
// PortSearch causes ZeroTier to try other ports automatically if it can't bind to configured ports
PortSearch bool
// PortMappingEnabled enables uPnP and NAT-PMP support
PortMappingEnabled bool
// PortMapping enables uPnP and NAT-PMP support
PortMapping bool
// MultipathMode sets the multipath link aggregation mode
MuiltipathMode int
@ -87,8 +87,8 @@ func (lc *LocalConfig) Read(p string, saveDefaultsIfNotExist bool) error {
lc.Settings.PrimaryPort = 9993
lc.Settings.SecondaryPort = 16384 + (rand.Int() % 16384)
lc.Settings.TertiaryPort = 32768 + (rand.Int() % 16384)
lc.Settings.PortAutoSearch = true
lc.Settings.PortMappingEnabled = true
lc.Settings.PortSearch = true
lc.Settings.PortMapping = true
lc.Settings.MuiltipathMode = 0
switch runtime.GOOS {
case "darwin":

View file

@ -187,7 +187,7 @@ func NewNode(basePath string) (*Node, error) {
return nil, err
}
if n.localConfig.Settings.PortAutoSearch {
if n.localConfig.Settings.PortSearch {
portsChanged := false
portCheckCount := 0