From e02a1552e96677bdbb849d563508ef27b0f459d7 Mon Sep 17 00:00:00 2001 From: Callan Bryant Date: Mon, 2 Mar 2020 20:11:33 +0000 Subject: [PATCH] MustChooseIP -> MustAllocateIP --- add.go | 2 +- init.go | 2 +- types.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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