mirror of
https://github.com/moby/moby.git
synced 2026-08-03 22:51:03 +00:00
Prioritize nw endpoint which can provide both v4 and v6 connectivity
- when selecting sandbox's default gw Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
@@ -1174,6 +1174,17 @@ func (eh epHeap) Less(i, j int) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
if epi.joinInfo != nil && epj.joinInfo != nil {
|
||||
if (epi.joinInfo.gw != nil && epi.joinInfo.gw6 != nil) &&
|
||||
(epj.joinInfo.gw == nil || epj.joinInfo.gw6 == nil) {
|
||||
return true
|
||||
}
|
||||
if (epj.joinInfo.gw != nil && epj.joinInfo.gw6 != nil) &&
|
||||
(epi.joinInfo.gw == nil || epi.joinInfo.gw6 == nil) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if ci != nil {
|
||||
cip, ok = ci.epPriority[eh[i].ID()]
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user