Skip to content

Commit 01a5586

Browse files
committed
libnetwork/drivers/bridge: setupIPChains: fix defer checking wrong err
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 <[email protected]>
1 parent 51abfcb commit 01a5586

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libnetwork/drivers/bridge/setup_ip_tables_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func setupIPChains(config configuration, version iptables.IPVersion) (natChain *
7272
return nil, nil, nil, nil, fmt.Errorf("failed to create FILTER chain %s: %v", DockerChain, err)
7373
}
7474
defer func() {
75-
if err != nil {
75+
if retErr != nil {
7676
if err := iptable.RemoveExistingChain(DockerChain, iptables.Filter); err != nil {
7777
log.G(context.TODO()).Warnf("failed on removing iptables FILTER chain %s on cleanup: %v", DockerChain, err)
7878
}

0 commit comments

Comments
 (0)