mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +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
|
// https://github.com/containernetworking/plugins/pull/75
|
||||||
if resultStruct.IPs != nil {
|
if resultStruct.IPs != nil {
|
||||||
for _, ip := range resultStruct.IPs {
|
for _, ip := range resultStruct.IPs {
|
||||||
|
if ip.Address.IP.To4() != nil {
|
||||||
iptablesDNS("-I", ip.Address.IP.String())
|
iptablesDNS("-I", ip.Address.IP.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,8 +175,10 @@ func (r *Runtime) teardownNetNS(ctr *Container) error {
|
|||||||
// on cleanup. Remove when https://github.com/containernetworking/plugins/pull/75
|
// on cleanup. Remove when https://github.com/containernetworking/plugins/pull/75
|
||||||
// is merged.
|
// is merged.
|
||||||
for _, ip := range ctr.state.IPs {
|
for _, ip := range ctr.state.IPs {
|
||||||
|
if ip.Address.IP.To4() != nil {
|
||||||
iptablesDNS("-D", ip.Address.IP.String())
|
iptablesDNS("-D", ip.Address.IP.String())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
logrus.Debugf("Tearing down network namespace at %s for container %s", ctr.state.NetNS.Path(), ctr.ID())
|
logrus.Debugf("Tearing down network namespace at %s for container %s", ctr.state.NetNS.Path(), ctr.ID())
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user