MustChooseIP -> MustAllocateIP

This commit is contained in:
Callan Bryant 2020-03-02 20:11:33 +00:00
parent 089ed04173
commit e02a1552e9
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA
3 changed files with 3 additions and 3 deletions

2
add.go
View File

@ -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,

View File

@ -21,7 +21,7 @@ func Init() {
ReportFile: DEFAULT_REPORT_FILE,
}
IP := conf.MustChooseIP()
IP := conf.MustAllocateIP()
conf.IP = IP
conf.DNS = IP

View File

@ -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