summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-26 16:09:21 +0200
committerGitHub <noreply@github.com>2021-07-26 16:09:21 +0200
commit4f5b19c5080543974c3498804b43d277271b2f33 (patch)
tree738d1cec5b5b08f2740bf79116680abf4c840efc /libpod
parent89853a30ebc65d9357759c2e1f470b7e2f4f6760 (diff)
parent8d5d5face5198b1024d85acbd497b5a0c6b6f4dc (diff)
downloadpodman-4f5b19c5080543974c3498804b43d277271b2f33.tar.gz
podman-4f5b19c5080543974c3498804b43d277271b2f33.tar.bz2
podman-4f5b19c5080543974c3498804b43d277271b2f33.zip
Merge pull request #11047 from Luap99/fix-11032
dual-stack network: fix duplicated subnet assignment
Diffstat (limited to 'libpod')
-rw-r--r--libpod/network/network.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/network/network.go b/libpod/network/network.go
index ed4e6388a..805988432 100644
--- a/libpod/network/network.go
+++ b/libpod/network/network.go
@@ -111,8 +111,10 @@ func allocatorToIPNets(networks []*allocator.Net) []*net.IPNet {
if len(network.IPAM.Ranges) > 0 {
// this is the new IPAM range style
// append each subnet from ipam the rangeset
- for _, r := range network.IPAM.Ranges[0] {
- nets = append(nets, newIPNetFromSubnet(r.Subnet))
+ for _, allocatorRange := range network.IPAM.Ranges {
+ for _, r := range allocatorRange {
+ nets = append(nets, newIPNetFromSubnet(r.Subnet))
+ }
}
} else {
// looks like the old, deprecated style