Merge pull request #17424 from coolljt0725/fix_inspect_gateway_value

Fix docker inspect display odd gateway value for none network mode
Upstream-commit: 54d42f4a107641c2755ea1d6e55ca41d8945f4f8
Component: engine
This commit is contained in:
David Calavera
2015-10-28 13:39:59 -07:00
+3 -1
View File
@@ -714,7 +714,9 @@ func (container *Container) updateJoinInfo(n libnetwork.Network, ep libnetwork.E
// It is not an error to get an empty endpoint info
return nil
}
container.NetworkSettings.Networks[n.Name()].Gateway = epInfo.Gateway().String()
if epInfo.Gateway() != nil {
container.NetworkSettings.Networks[n.Name()].Gateway = epInfo.Gateway().String()
}
if epInfo.GatewayIPv6().To16() != nil {
container.NetworkSettings.Networks[n.Name()].IPv6Gateway = epInfo.GatewayIPv6().String()
}