Merge pull request #16282 from mavenugo/ln_uns
Vendor-in libnetwork 2baa2ddc78b42f011f55633282ac63a72e1b09c1 Upstream-commit: 370ca6e401b251085a33f50e842f6567d2e9924e Component: engine
This commit is contained in:
@@ -580,13 +580,11 @@ func (container *Container) buildEndpointInfo(ep libnetwork.Endpoint, networkSet
|
||||
return networkSettings, nil
|
||||
}
|
||||
|
||||
ifaceList := epInfo.InterfaceList()
|
||||
if len(ifaceList) == 0 {
|
||||
iface := epInfo.Iface()
|
||||
if iface == nil {
|
||||
return networkSettings, nil
|
||||
}
|
||||
|
||||
iface := ifaceList[0]
|
||||
|
||||
ones, _ := iface.Address().Mask.Size()
|
||||
networkSettings.IPAddress = iface.Address().IP.String()
|
||||
networkSettings.IPPrefixLen = ones
|
||||
@@ -597,24 +595,6 @@ func (container *Container) buildEndpointInfo(ep libnetwork.Endpoint, networkSet
|
||||
networkSettings.GlobalIPv6PrefixLen = onesv6
|
||||
}
|
||||
|
||||
if len(ifaceList) == 1 {
|
||||
return networkSettings, nil
|
||||
}
|
||||
|
||||
networkSettings.SecondaryIPAddresses = make([]network.Address, 0, len(ifaceList)-1)
|
||||
networkSettings.SecondaryIPv6Addresses = make([]network.Address, 0, len(ifaceList)-1)
|
||||
for _, iface := range ifaceList[1:] {
|
||||
ones, _ := iface.Address().Mask.Size()
|
||||
addr := network.Address{Addr: iface.Address().IP.String(), PrefixLen: ones}
|
||||
networkSettings.SecondaryIPAddresses = append(networkSettings.SecondaryIPAddresses, addr)
|
||||
|
||||
if iface.AddressIPv6().IP.To16() != nil {
|
||||
onesv6, _ := iface.AddressIPv6().Mask.Size()
|
||||
addrv6 := network.Address{Addr: iface.AddressIPv6().IP.String(), PrefixLen: onesv6}
|
||||
networkSettings.SecondaryIPv6Addresses = append(networkSettings.SecondaryIPv6Addresses, addrv6)
|
||||
}
|
||||
}
|
||||
|
||||
return networkSettings, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -820,9 +820,9 @@ func (daemon *Daemon) Shutdown() error {
|
||||
}
|
||||
group.Wait()
|
||||
|
||||
// trigger libnetwork GC only if it's initialized
|
||||
// trigger libnetwork Stop only if it's initialized
|
||||
if daemon.netController != nil {
|
||||
daemon.netController.GC()
|
||||
daemon.netController.Stop()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user