mirror of
https://github.com/slackhq/nebula.git
synced 2025-12-06 02:30:57 -08:00
add tests and improve error
This commit is contained in:
parent
83d2550b2d
commit
08915315ff
3 changed files with 27 additions and 5 deletions
|
|
@ -53,16 +53,16 @@ func NewLightHouse(amLighthouse bool, myIp uint32, ips []string, interval int, n
|
|||
return &h
|
||||
}
|
||||
|
||||
func (lh *LightHouse) ValidateLHStaticEntries() (bool, error) {
|
||||
func (lh *LightHouse) ValidateLHStaticEntries() error {
|
||||
for lhIP, _ := range lh.lighthouses {
|
||||
for ip, _ := range lh.staticList {
|
||||
if lhIP == ip {
|
||||
continue
|
||||
}
|
||||
return false, fmt.Errorf("Lighthouse %s does not have a static_host_map entry", IntIp(lhIP))
|
||||
return fmt.Errorf("Lighthouse %s does not have a static_host_map entry", IntIp(lhIP))
|
||||
}
|
||||
}
|
||||
return true, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func (lh *LightHouse) Query(ip uint32, f EncWriter) ([]udpAddr, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue