From 301a8afff578a8467e98f1081aa96323c458e1f1 Mon Sep 17 00:00:00 2001
From: Solomon Hykes <solomon@dotcloud.com>
Date: Fri, 22 Mar 2013 22:31:20 -0700
Subject: [PATCH] Properly cleanup iptables rules inserted in OUTPUT
 (introduced in 3c6b8bb8882fcd2083d1c489df3cc40062b4896c)

---
 network.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/network.go b/network.go
index 73cb1709af..b2c6f638ce 100644
--- a/network.go
+++ b/network.go
@@ -111,6 +111,7 @@ type PortMapper struct {
 func (mapper *PortMapper) cleanup() error {
 	// Ignore errors - This could mean the chains were never set up
 	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)