Check loopback and link-local multicast endpoints

Previously we just disallowed link-local (unicast).  This disallows loopback
and link-local multicast.
This commit is contained in:
Tim Hockin
2015-07-03 21:05:15 -07:00
parent b5a4a548df
commit 86f4535871
7 changed files with 47 additions and 16 deletions

View File

@@ -286,7 +286,7 @@ func setDefaults(c *Config) {
if c.CacheTimeout == 0 {
c.CacheTimeout = 5 * time.Second
}
for c.PublicAddress == nil || c.PublicAddress.IsUnspecified() {
for c.PublicAddress == nil || c.PublicAddress.IsUnspecified() || c.PublicAddress.IsLoopback() {
// TODO: This should be done in the caller and just require a
// valid value to be passed in.
hostIP, err := util.ChooseHostInterface()