Skip to content

Commit

Permalink
libnetwork/drivers/bridge: setupIPChains: fix defer checking wrong err
Browse files Browse the repository at this point in the history
The output variable was renamed in 0503cf2,
but that commit failed to change this defer, which was now checking the
wrong error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Dec 16, 2024
1 parent 51abfcb commit 01a5586
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 @@ -72,7 +72,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 01a5586

Please sign in to comment.