Skip to content

Commit

Permalink
Merge pull request containernetworking#191 from dcbw/portmap-panic-fix
Browse files Browse the repository at this point in the history
portmap: don't panic if listing a chain returns fewer lines than exected
  • Loading branch information
dcbw committed Sep 5, 2018
2 parents 6a12a37 + 7d32921 commit 35b87a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/meta/portmap/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (c *chain) teardown(ipt *iptables.IPTables) error {

for _, entryChain := range c.entryChains {
entryChainRules, err := ipt.List(c.table, entryChain)
if err != nil {
if err != nil || len(entryChainRules) < 1 {
// Swallow error here - probably the chain doesn't exist.
// If we miss something the deletion will fail
continue
Expand Down

0 comments on commit 35b87a3

Please sign in to comment.