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

Commit

Permalink
reuse dummy variable
Browse files Browse the repository at this point in the history
  • Loading branch information
murali-reddy committed Jan 22, 2019
1 parent 472b7b1 commit aa6db6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ func (b bridgeImpl) initPrep(config *BridgeConfig) error {
// fails. Bridges take the lowest MTU of their interfaces. So
// instead we create a temporary interface with the desired MTU,
// attach that to the bridge, and then remove it again.
dummy := &netlink.Dummy{LinkAttrs: netlink.NewLinkAttrs()}
dummy.LinkAttrs.Name = WeaveDummyIfName
var dummy netlink.Link
dummy = &netlink.Dummy{LinkAttrs: netlink.NewLinkAttrs()}
dummy.Attrs().Name = WeaveDummyIfName
if err = LinkAddIfNotExist(dummy); err != nil {
return errors.Wrap(err, "creating dummy interface")
}
defer func() {
var dummy netlink.Link
dummy, err = netlink.LinkByName(WeaveDummyIfName)
if err == nil {
if err = netlink.LinkDel(dummy); err != nil {
Expand Down

0 comments on commit aa6db6c

Please sign in to comment.