Docker side changes for the newly introduced IPAM driver
* Made use of IPAM driver primitives for legacy IP configurations * Replaced custom Generics with backend labels Signed-off-by: Madhu Venugopal <madhu@docker.com> Upstream-commit: 0f351ce3643a97d4b6af0021826b851f9ba41967 Component: engine
This commit is contained in:
@ -204,12 +204,12 @@ func buildEndpointResource(e libnetwork.Endpoint) types.EndpointResource {
|
||||
if mac := iface.MacAddress(); mac != nil {
|
||||
er.MacAddress = mac.String()
|
||||
}
|
||||
if ip := iface.Address(); len(ip.IP) > 0 {
|
||||
er.IPv4Address = (&ip).String()
|
||||
if ip := iface.Address(); ip != nil && len(ip.IP) > 0 {
|
||||
er.IPv4Address = ip.String()
|
||||
}
|
||||
|
||||
if ipv6 := iface.AddressIPv6(); len(ipv6.IP) > 0 {
|
||||
er.IPv6Address = (&ipv6).String()
|
||||
if ipv6 := iface.AddressIPv6(); ipv6 != nil && len(ipv6.IP) > 0 {
|
||||
er.IPv6Address = ipv6.String()
|
||||
}
|
||||
}
|
||||
return er
|
||||
|
||||
Reference in New Issue
Block a user