mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Continue cleaning up iptables rules from previous version, to avoid crashing after an upgrade
This commit is contained in:
parent
c4d3da5871
commit
ebc837957f
1 changed files with 3 additions and 0 deletions
|
@ -100,6 +100,9 @@ func (mapper *PortMapper) cleanup() error {
|
|||
// Ignore errors - This could mean the chains were never set up
|
||||
iptables("-t", "nat", "-D", "PREROUTING", "-m", "addrtype", "--dst-type", "LOCAL", "-j", "DOCKER")
|
||||
iptables("-t", "nat", "-D", "OUTPUT", "-m", "addrtype", "--dst-type", "LOCAL", "-j", "DOCKER")
|
||||
// Also cleanup rules created by older versions, or -X might fail.
|
||||
iptables("-t", "nat", "-D", "PREROUTING", "-j", "DOCKER")
|
||||
iptables("-t", "nat", "-D", "OUTPUT", "-j", "DOCKER")
|
||||
iptables("-t", "nat", "-F", "DOCKER")
|
||||
iptables("-t", "nat", "-X", "DOCKER")
|
||||
mapper.mapping = make(map[int]net.TCPAddr)
|
||||
|
|
Loading…
Reference in a new issue