diff options
author | Wim <wim@42.be> | 2018-06-17 01:11:46 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-17 15:16:56 +0000 |
commit | fc5e3706e9b9f81d5ce75e3013488dc23cb6558d (patch) | |
tree | 3cae4a34a5f69bd62a02e68e312677a32db84c23 | |
parent | b43677c9fd7f04c1ebf8265a0b14fc8ed70e4d66 (diff) | |
download | podman-fc5e3706e9b9f81d5ce75e3013488dc23cb6558d.tar.gz podman-fc5e3706e9b9f81d5ce75e3013488dc23cb6558d.tar.bz2 podman-fc5e3706e9b9f81d5ce75e3013488dc23cb6558d.zip |
Do not run iptablesDNS workaround on IPv6 addresses
Closes: #954
Approved by: mheon
-rw-r--r-- | libpod/networking.go | 8 |
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()) |