Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
reuse dummy netlink object to delete the interface
Browse files Browse the repository at this point in the history
  • Loading branch information
murali-reddy committed Feb 12, 2019
1 parent db47f17 commit 7f85a01
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,8 @@ func (b bridgeImpl) initPrep(config *BridgeConfig) error {
return errors.Wrap(err, "creating dummy interface")
}
defer func() {
dummy, err = netlink.LinkByName(WeaveDummyIfName)
if err == nil {
if err = netlink.LinkDel(dummy); err != nil {
err = errors.Wrap(err, "deleting dummy interface")
}
if err = netlink.LinkDel(dummy); err != nil {
err = errors.Wrap(err, "deleting dummy interface")
}
}()
if err := netlink.LinkSetMTU(dummy, config.MTU); err != nil {
Expand Down

0 comments on commit 7f85a01

Please sign in to comment.