diff --git a/add.go b/add.go index b1762e3..a1f83d0 100644 --- a/add.go +++ b/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, diff --git a/init.go b/init.go index af8bfb0..73c3fc2 100644 --- a/init.go +++ b/init.go @@ -21,7 +21,7 @@ func Init() { ReportFile: DEFAULT_REPORT_FILE, } - IP := conf.MustChooseIP() + IP := conf.MustAllocateIP() conf.IP = IP conf.DNS = IP diff --git a/types.go b/types.go index 081eba3..03a3b69 100644 --- a/types.go +++ b/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