mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 10:37:33 -07:00
Go CLI work
This commit is contained in:
parent
a7e38d2b00
commit
f4a5abeed9
7 changed files with 154 additions and 10 deletions
|
@ -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":
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue