|
|
@ -48,6 +48,9 @@ func InternalIP() string { |
|
|
|
return "" |
|
|
|
return "" |
|
|
|
} |
|
|
|
} |
|
|
|
for _, inter := range inters { |
|
|
|
for _, inter := range inters { |
|
|
|
|
|
|
|
if !isUp(inter.Flags) { |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} |
|
|
|
if !strings.HasPrefix(inter.Name, "lo") { |
|
|
|
if !strings.HasPrefix(inter.Name, "lo") { |
|
|
|
addrs, err := inter.Addrs() |
|
|
|
addrs, err := inter.Addrs() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
@ -64,3 +67,8 @@ func InternalIP() string { |
|
|
|
} |
|
|
|
} |
|
|
|
return "" |
|
|
|
return "" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isUp Interface is up
|
|
|
|
|
|
|
|
func isUp(v net.Flags) bool { |
|
|
|
|
|
|
|
return v&net.FlagUp == net.FlagUp
|
|
|
|
|
|
|
|
} |
|
|
|