Commit 0235bca2 authored by fabianofranz's avatar fabianofranz

When choosing a host interface proxier must only consider the ones with an address assigned

parent 6894d4fe
...@@ -766,8 +766,14 @@ func chooseHostInterface() (net.IP, error) { ...@@ -766,8 +766,14 @@ func chooseHostInterface() (net.IP, error) {
i := 0 i := 0
for i = range intfs { for i = range intfs {
if flagsSet(intfs[i].Flags, net.FlagUp) && flagsClear(intfs[i].Flags, net.FlagLoopback|net.FlagPointToPoint) { if flagsSet(intfs[i].Flags, net.FlagUp) && flagsClear(intfs[i].Flags, net.FlagLoopback|net.FlagPointToPoint) {
// This interface should suffice. addrs, err := intfs[i].Addrs()
break if err != nil {
return nil, err
}
if len(addrs) > 0 {
// This interface should suffice.
break
}
} }
} }
if i == len(intfs) { if i == len(intfs) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment