Merge pull request #1248 from mavenugo/addr

Resolve host-name before trying the interface-name in agent bind
This commit is contained in:
Jana Radhakrishnan 2016-06-12 10:58:57 -07:00 committed by GitHub
commit 08014eadb6
1 changed files with 6 additions and 2 deletions

View File

@ -69,8 +69,12 @@ func resolveAddr(addrOrInterface string) (string, error) {
return addrOrInterface, nil
}
// If not a valid IP address, it should be a valid interface
return getBindAddr(addrOrInterface)
addr, err := net.ResolveIPAddr("ip", addrOrInterface)
if err != nil {
// If not a valid IP address, it should be a valid interface
return getBindAddr(addrOrInterface)
}
return addr.String(), nil
}
func (c *controller) handleKeyChange(keys []*types.EncryptionKey) error {