Skip to content

Commit

Permalink
Merge branch 'release/1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
deviantony committed Aug 1, 2018
2 parents 7e16e6b + 4909769 commit 760ed30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type (

const (
// AgentVersion represents the version of the agent.
AgentVersion = "1.1.1"
AgentVersion = "1.1.2"
// DefaultListenAddr is the default address used by the web server.
DefaultListenAddr = "0.0.0.0"
// DefaultAgentPort is the default port exposed by the web server.
Expand Down
9 changes: 6 additions & 3 deletions cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,19 @@ func retrieveAdvertiseAddress() (string, error) {

var advertiseAddr string
for _, i := range ifaces {
if matched, _ := regexp.MatchString(`^(eth0)$||^(vEthernet) \(.*\)$`, i.Name); matched {
var ip net.IP
addrs, _ := i.Addrs()
if matched, _ := regexp.MatchString(`^(eth0)$|^(vEthernet) \(.*\)$`, i.Name); matched {
addrs, err := i.Addrs()
if err != nil {
return "", err
}

j := 0
// On Windows first IP address is link-local IPv6
if runtime.GOOS == "windows" {
j = 1
}

var ip net.IP
switch v := addrs[j].(type) {
case *net.IPNet:
ip = v.IP
Expand Down

0 comments on commit 760ed30

Please sign in to comment.