MustChooseIP -> MustAllocateIP
This commit is contained in:
parent
089ed04173
commit
e02a1552e9
2
add.go
2
add.go
@ -11,7 +11,7 @@ func Add(hostname string, owner string, description string) { //, publicKey stri
|
||||
presharedKey := GenerateJSONKey()
|
||||
publicKey := privateKey.PublicKey()
|
||||
|
||||
IP := conf.MustChooseIP()
|
||||
IP := conf.MustAllocateIP()
|
||||
|
||||
peer := PeerConfig{
|
||||
Owner: owner,
|
||||
|
2
init.go
2
init.go
@ -21,7 +21,7 @@ func Init() {
|
||||
ReportFile: DEFAULT_REPORT_FILE,
|
||||
}
|
||||
|
||||
IP := conf.MustChooseIP()
|
||||
IP := conf.MustAllocateIP()
|
||||
conf.IP = IP
|
||||
conf.DNS = IP
|
||||
|
||||
|
2
types.go
2
types.go
@ -115,7 +115,7 @@ func (conf DsnetConfig) IPAllocated(IP net.IP) bool {
|
||||
}
|
||||
|
||||
// choose a free IP for a new Peer
|
||||
func (conf DsnetConfig) MustChooseIP() net.IP {
|
||||
func (conf DsnetConfig) MustAllocateIP() net.IP {
|
||||
network := conf.Network.IPNet
|
||||
ones, bits := network.Mask.Size()
|
||||
zeros := bits - ones
|
||||
|
Loading…
Reference in New Issue
Block a user