mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
Do not run iptablesDNS workaround on IPv6 addresses
Closes: #954 Approved by: mheon
This commit is contained in:
@ -61,9 +61,11 @@ 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 {
|
||||
if ip.Address.IP.To4() != nil {
|
||||
iptablesDNS("-I", ip.Address.IP.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -173,8 +175,10 @@ 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 {
|
||||
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())
|
||||
|
||||
|
Reference in New Issue
Block a user