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,10 +766,16 @@ func chooseHostInterface() (net.IP, error) { ...@@ -766,10 +766,16 @@ 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) {
addrs, err := intfs[i].Addrs()
if err != nil {
return nil, err
}
if len(addrs) > 0 {
// This interface should suffice. // This interface should suffice.
break break
} }
} }
}
if i == len(intfs) { if i == len(intfs) {
return nil, err return nil, err
} }
......
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