Resolve host-name before trying the interface-name in agent bind

Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
Madhu Venugopal 2016-06-12 10:08:26 -07:00
parent 15ee7ae763
commit 64d8c5f87f
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 {