"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "components/engine/vendor/github.com/docker/libnetwork/network.go" between
docker-ce-19.03.2.tar.gz and docker-ce-19.03.3.tar.gz

About: Docker CE is a project to pack, ship and run any application as a lightweight container. Docker containers can run anywhere, on a laptop or at scale, in production, on VMs, bare metal, OpenStack clusters, public clouds and more. Community edition.

network.go  (docker-ce-19.03.2):network.go  (docker-ce-19.03.3)
skipping to change at line 1057 skipping to change at line 1057
return fmt.Errorf("error marking network %s (%s) for deletion: %v ", n.Name(), n.ID(), err) return fmt.Errorf("error marking network %s (%s) for deletion: %v ", n.Name(), n.ID(), err)
} }
if n.ConfigFrom() != "" { if n.ConfigFrom() != "" {
if t, err := c.getConfigNetwork(n.ConfigFrom()); err == nil { if t, err := c.getConfigNetwork(n.ConfigFrom()); err == nil {
if err := t.getEpCnt().DecEndpointCnt(); err != nil { if err := t.getEpCnt().DecEndpointCnt(); err != nil {
logrus.Warnf("Failed to update reference count fo r configuration network %q on removal of network %q: %v", logrus.Warnf("Failed to update reference count fo r configuration network %q on removal of network %q: %v",
t.Name(), n.Name(), err) t.Name(), n.Name(), err)
} }
} else { } else {
logrus.Warnf("Could not find configuration network %q dur ing removal of network %q", n.configOnly, n.Name()) logrus.Warnf("Could not find configuration network %q dur ing removal of network %q", n.configFrom, n.Name())
} }
} }
if n.configOnly { if n.configOnly {
goto removeFromStore goto removeFromStore
} }
if err = n.deleteNetwork(); err != nil { if err = n.deleteNetwork(); err != nil {
if !force { if !force {
return err return err
skipping to change at line 1384 skipping to change at line 1384
func delIPToName(ipMap setmatrix.SetMatrix, name, serviceID string, ip net.IP) { func delIPToName(ipMap setmatrix.SetMatrix, name, serviceID string, ip net.IP) {
reverseIP := netutils.ReverseIP(ip.String()) reverseIP := netutils.ReverseIP(ip.String())
ipMap.Remove(reverseIP, ipInfo{ ipMap.Remove(reverseIP, ipInfo{
name: name, name: name,
serviceID: serviceID, serviceID: serviceID,
}) })
} }
func addNameToIP(svcMap setmatrix.SetMatrix, name, serviceID string, epIP net.IP ) { func addNameToIP(svcMap setmatrix.SetMatrix, name, serviceID string, epIP net.IP ) {
svcMap.Insert(name, svcMapEntry{ // Since DNS name resolution is case-insensitive, Use the lower-case form
// of the name as the key into svcMap
lowerCaseName := strings.ToLower(name)
svcMap.Insert(lowerCaseName, svcMapEntry{
ip: epIP.String(), ip: epIP.String(),
serviceID: serviceID, serviceID: serviceID,
}) })
} }
func delNameToIP(svcMap setmatrix.SetMatrix, name, serviceID string, epIP net.IP ) { func delNameToIP(svcMap setmatrix.SetMatrix, name, serviceID string, epIP net.IP ) {
svcMap.Remove(name, svcMapEntry{ lowerCaseName := strings.ToLower(name)
svcMap.Remove(lowerCaseName, svcMapEntry{
ip: epIP.String(), ip: epIP.String(),
serviceID: serviceID, serviceID: serviceID,
}) })
} }
func (n *network) addSvcRecords(eID, name, serviceID string, epIP, epIPv6 net.IP , ipMapUpdate bool, method string) { func (n *network) addSvcRecords(eID, name, serviceID string, epIP, epIPv6 net.IP , ipMapUpdate bool, method string) {
// Do not add service names for ingress network as this is a // Do not add service names for ingress network as this is a
// routing only network // routing only network
if n.ingress { if n.ingress {
return return
skipping to change at line 1937 skipping to change at line 1941
t := networkDBTable{ t := networkDBTable{
name: tableName, name: tableName,
objType: objType, objType: objType,
} }
n.Lock() n.Lock()
defer n.Unlock() defer n.Unlock()
n.driverTables = append(n.driverTables, t) n.driverTables = append(n.driverTables, t)
return nil return nil
} }
func (n *network) UpdateIpamConfig(ipV4Data []driverapi.IPAMData) {
ipamV4Config := make([]*IpamConf, len(ipV4Data))
for i, data := range ipV4Data {
ic := &IpamConf{}
ic.PreferredPool = data.Pool.String()
ic.Gateway = data.Gateway.IP.String()
ipamV4Config[i] = ic
}
n.Lock()
defer n.Unlock()
n.ipamV4Config = ipamV4Config
}
// Special drivers are ones which do not need to perform any network plumbing // Special drivers are ones which do not need to perform any network plumbing
func (n *network) hasSpecialDriver() bool { func (n *network) hasSpecialDriver() bool {
return n.Type() == "host" || n.Type() == "null" return n.Type() == "host" || n.Type() == "null"
} }
func (n *network) hasLoadBalancerEndpoint() bool { func (n *network) hasLoadBalancerEndpoint() bool {
return len(n.loadBalancerIP) != 0 return len(n.loadBalancerIP) != 0
} }
func (n *network) ResolveName(req string, ipType int) ([]net.IP, bool) { func (n *network) ResolveName(req string, ipType int) ([]net.IP, bool) {
skipping to change at line 1959 skipping to change at line 1979
c := n.getController() c := n.getController()
c.Lock() c.Lock()
defer c.Unlock() defer c.Unlock()
sr, ok := c.svcRecords[n.ID()] sr, ok := c.svcRecords[n.ID()]
if !ok { if !ok {
return nil, false return nil, false
} }
req = strings.TrimSuffix(req, ".") req = strings.TrimSuffix(req, ".")
req = strings.ToLower(req)
ipSet, ok := sr.svcMap.Get(req) ipSet, ok := sr.svcMap.Get(req)
if ipType == types.IPv6 { if ipType == types.IPv6 {
// If the name resolved to v4 address then its a valid name in // If the name resolved to v4 address then its a valid name in
// the docker network domain. If the network is not v6 enabled // the docker network domain. If the network is not v6 enabled
// set ipv6Miss to filter the DNS query from going to external // set ipv6Miss to filter the DNS query from going to external
// resolvers. // resolvers.
if ok && !n.enableIPv6 { if ok && !n.enableIPv6 {
ipv6Miss = true ipv6Miss = true
} }
 End of changes. 5 change blocks. 
3 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)