summaryrefslogtreecommitdiff
path: root/libpod/networking_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-17 00:21:31 +0100
committerGitHub <noreply@github.com>2021-11-17 00:21:31 +0100
commitc6616648780881ac717817cf79de84084ce7c02f (patch)
tree0e356fc32d4765f141395bd8fa2d7551c80a65bc /libpod/networking_linux.go
parent059785c3edfe937ce8f39d235440bf0e03620ed8 (diff)
parent97c6403a1bcde8501955fb1798740cf125597881 (diff)
downloadpodman-c6616648780881ac717817cf79de84084ce7c02f.tar.gz
podman-c6616648780881ac717817cf79de84084ce7c02f.tar.bz2
podman-c6616648780881ac717817cf79de84084ce7c02f.zip
Merge pull request #12319 from Luap99/nettypes-rename
rename libpod nettypes fields
Diffstat (limited to 'libpod/networking_linux.go')
-rw-r--r--libpod/networking_linux.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 8ce435efd..9be600bb4 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -937,8 +937,8 @@ func (r *Runtime) reloadContainerNetwork(ctr *Container) (map[string]types.Statu
Aliases: aliases[network],
StaticMAC: netInt.MacAddress,
}
- for _, netAddress := range netInt.Networks {
- perNetOpts.StaticIPs = append(perNetOpts.StaticIPs, netAddress.Subnet.IP)
+ for _, netAddress := range netInt.Subnets {
+ perNetOpts.StaticIPs = append(perNetOpts.StaticIPs, netAddress.IPNet.IP)
}
// Normally interfaces have a length of 1, only for some special cni configs we could get more.
// For now just use the first interface to get the ips this should be good enough for most cases.
@@ -1124,25 +1124,25 @@ func (c *Container) setupNetworkDescriptions(networks []string) error {
func resultToBasicNetworkConfig(result types.StatusBlock) (define.InspectBasicNetworkConfig, error) {
config := define.InspectBasicNetworkConfig{}
for _, netInt := range result.Interfaces {
- for _, netAddress := range netInt.Networks {
- size, _ := netAddress.Subnet.Mask.Size()
- if netAddress.Subnet.IP.To4() != nil {
+ for _, netAddress := range netInt.Subnets {
+ size, _ := netAddress.IPNet.Mask.Size()
+ if netAddress.IPNet.IP.To4() != nil {
//ipv4
if config.IPAddress == "" {
- config.IPAddress = netAddress.Subnet.IP.String()
+ config.IPAddress = netAddress.IPNet.IP.String()
config.IPPrefixLen = size
config.Gateway = netAddress.Gateway.String()
} else {
- config.SecondaryIPAddresses = append(config.SecondaryIPAddresses, netAddress.Subnet.IP.String())
+ config.SecondaryIPAddresses = append(config.SecondaryIPAddresses, netAddress.IPNet.IP.String())
}
} else {
//ipv6
if config.GlobalIPv6Address == "" {
- config.GlobalIPv6Address = netAddress.Subnet.IP.String()
+ config.GlobalIPv6Address = netAddress.IPNet.IP.String()
config.GlobalIPv6PrefixLen = size
config.IPv6Gateway = netAddress.Gateway.String()
} else {
- config.SecondaryIPv6Addresses = append(config.SecondaryIPv6Addresses, netAddress.Subnet.IP.String())
+ config.SecondaryIPv6Addresses = append(config.SecondaryIPv6Addresses, netAddress.IPNet.IP.String())
}
}
}