Skip to content

Commit

Permalink
Merge pull request #49110 from thaJeztah/27.x_backport_fix_setupIPCha…
Browse files Browse the repository at this point in the history
…ins_defer

[27.x backport] libnetwork/drivers/bridge: setupIPChains: fix defer checking wrong err
  • Loading branch information
akerouanton authored Dec 16, 2024
2 parents 135b144 + 08de719 commit bd7da11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libnetwork/drivers/bridge/setup_ip_tables_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func setupIPChains(config configuration, version iptables.IPVersion) (natChain *
return nil, nil, nil, nil, fmt.Errorf("failed to create FILTER chain %s: %v", DockerChain, err)
}
defer func() {
if err != nil {
if retErr != nil {
if err := iptable.RemoveExistingChain(DockerChain, iptables.Filter); err != nil {
log.G(context.TODO()).Warnf("failed on removing iptables FILTER chain %s on cleanup: %v", DockerChain, err)
}
Expand Down

0 comments on commit bd7da11

Please sign in to comment.