diff --git a/config.go b/config.go index 2c14489..b9fd051 100644 --- a/config.go +++ b/config.go @@ -6,6 +6,7 @@ import ( "github.com/costela/wesher/cluster" "github.com/hashicorp/go-sockaddr" + "github.com/mikioh/ipaddr" "github.com/pkg/errors" "github.com/stevenroose/gonfig" ) @@ -81,8 +82,8 @@ func loadConfig() (*config, error) { } } - if config.AdvertiseAddr == "" { - config.AdvertiseAddr = config.BindAddr + if _, err := ipaddr.Parse(config.AdvertiseAddr); err != nil { + config.AdvertiseAddr = "" } return &config, nil