Skip to content

Commit

Permalink
When choosing a host interface proxier must only consider the ones wi…
Browse files Browse the repository at this point in the history
…th an address assigned
  • Loading branch information
fabianofranz committed Jan 14, 2015
1 parent 6894d4f commit 0235bca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/proxy/proxier.go
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,14 @@ func chooseHostInterface() (net.IP, error) {
i := 0
for i = range intfs {
if flagsSet(intfs[i].Flags, net.FlagUp) && flagsClear(intfs[i].Flags, net.FlagLoopback|net.FlagPointToPoint) {
// This interface should suffice.
break
addrs, err := intfs[i].Addrs()
if err != nil {
return nil, err
}
if len(addrs) > 0 {
// This interface should suffice.
break
}
}
}
if i == len(intfs) {
Expand Down

0 comments on commit 0235bca

Please sign in to comment.