summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
Diffstat (limited to 'libpod')
-rw-r--r--libpod/networking.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/libpod/networking.go b/libpod/networking.go
index 092ce2a3f..74ca340a0 100644
--- a/libpod/networking.go
+++ b/libpod/networking.go
@@ -61,7 +61,9 @@ func (r *Runtime) configureNetNS(ctr *Container, ctrNS ns.NetNS) (err error) {
// https://github.com/containernetworking/plugins/pull/75
if resultStruct.IPs != nil {
for _, ip := range resultStruct.IPs {
- iptablesDNS("-I", ip.Address.IP.String())
+ if ip.Address.IP.To4() != nil {
+ iptablesDNS("-I", ip.Address.IP.String())
+ }
}
}
return nil
@@ -173,7 +175,9 @@ func (r *Runtime) teardownNetNS(ctr *Container) error {
// on cleanup. Remove when https://github.com/containernetworking/plugins/pull/75
// is merged.
for _, ip := range ctr.state.IPs {
- iptablesDNS("-D", ip.Address.IP.String())
+ if ip.Address.IP.To4() != nil {
+ iptablesDNS("-D", ip.Address.IP.String())
+ }
}
logrus.Debugf("Tearing down network namespace at %s for container %s", ctr.state.NetNS.Path(), ctr.ID())