diff -Nru golang-github-coreos-go-iptables-0.4.4/debian/changelog golang-github-coreos-go-iptables-0.4.5/debian/changelog --- golang-github-coreos-go-iptables-0.4.4/debian/changelog 2019-12-15 04:08:59.000000000 +0000 +++ golang-github-coreos-go-iptables-0.4.5/debian/changelog 2019-12-19 05:27:04.000000000 +0000 @@ -1,3 +1,9 @@ +golang-github-coreos-go-iptables (0.4.5-1) unstable; urgency=medium + + * New upstream release. + + -- Dmitry Smirnov Thu, 19 Dec 2019 16:27:04 +1100 + golang-github-coreos-go-iptables (0.4.4-1) unstable; urgency=medium * New upstream release. diff -Nru golang-github-coreos-go-iptables-0.4.4/iptables/iptables.go golang-github-coreos-go-iptables-0.4.5/iptables/iptables.go --- golang-github-coreos-go-iptables-0.4.4/iptables/iptables.go 2019-12-13 10:13:15.000000000 +0000 +++ golang-github-coreos-go-iptables-0.4.5/iptables/iptables.go 2019-12-16 16:34:29.000000000 +0000 @@ -48,9 +48,13 @@ // IsNotExist returns true if the error is due to the chain or rule not existing func (e *Error) IsNotExist() bool { - return e.ExitStatus() == 1 && - strings.Contains(e.msg, fmt.Sprintf("%s: Bad rule (does a matching rule exist in that chain?).\n", getIptablesCommand(e.proto))) || - strings.Contains(e.msg, fmt.Sprintf("%s: No chain/target/match by that name.\n", getIptablesCommand(e.proto))) + if e.ExitStatus() != 1 { + return false + } + cmdIptables := getIptablesCommand(e.proto) + msgNoRuleExist := fmt.Sprintf("%s: Bad rule (does a matching rule exist in that chain?).\n", cmdIptables) + msgNoChainExist := fmt.Sprintf("%s: No chain/target/match by that name.\n", cmdIptables) + return strings.Contains(e.msg, msgNoRuleExist) || strings.Contains(e.msg, msgNoChainExist) } // Protocol to differentiate between IPv4 and IPv6