reset advertise addr if bad addr, same as memberlist behavior
(cherry picked from commit c27d37591589c7de2ca977e2e4c750b4fa4fb7a3)
This commit is contained in:
parent
c9afa9f5ef
commit
42f993b96d
|
@ -6,6 +6,7 @@ import (
|
||||||
|
|
||||||
"github.com/costela/wesher/cluster"
|
"github.com/costela/wesher/cluster"
|
||||||
"github.com/hashicorp/go-sockaddr"
|
"github.com/hashicorp/go-sockaddr"
|
||||||
|
"github.com/mikioh/ipaddr"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/stevenroose/gonfig"
|
"github.com/stevenroose/gonfig"
|
||||||
)
|
)
|
||||||
|
@ -81,8 +82,8 @@ func loadConfig() (*config, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.AdvertiseAddr == "" {
|
if _, err := ipaddr.Parse(config.AdvertiseAddr); err != nil {
|
||||||
config.AdvertiseAddr = config.BindAddr
|
config.AdvertiseAddr = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return &config, nil
|
return &config, nil
|
||||||
|
|
Loading…
Reference in New Issue