From efe741ad66bf69c7065ddff86fd7e85e2ad7903c Mon Sep 17 00:00:00 2001 From: Chad Harp Date: Thu, 2 Jan 2020 20:04:18 -0600 Subject: [PATCH] Allow ValidateLHStaticEntries to check all static host map entries (#141) * Allow ValidateLHStaticEntries to check all static host map entries * Cleaner fix for ValidateLHStaticEntries --- lighthouse.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lighthouse.go b/lighthouse.go index 233f088..8aeaced 100644 --- a/lighthouse.go +++ b/lighthouse.go @@ -55,10 +55,7 @@ func NewLightHouse(amLighthouse bool, myIp uint32, ips []uint32, interval int, n func (lh *LightHouse) ValidateLHStaticEntries() error { for lhIP, _ := range lh.lighthouses { - for ip, _ := range lh.staticList { - if lhIP == ip { - break - } + if _, ok := lh.staticList[lhIP]; !ok { return fmt.Errorf("Lighthouse %s does not have a static_host_map entry", IntIp(lhIP)) } }