Skip to content

Commit

Permalink
Replace correct usage for the netlink default
Browse files Browse the repository at this point in the history
This use case of the literal is correct, and calls out the reason for
explicitly setting TxQLen. This change switches to the helper still.

Signed-off-by: Gudmundur Bjarni Olafsson <[email protected]>
  • Loading branch information
gudmundur committed Sep 23, 2024
1 parent 306894e commit 4ffccfd
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions plugins/main/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,16 +335,11 @@ func bridgeByName(name string) (*netlink.Bridge, error) {
}

func ensureBridge(brName string, mtu int, promiscMode, vlanFiltering bool) (*netlink.Bridge, error) {
linkAttrs := netlink.NewLinkAttrs()
linkAttrs.Name = brName
linkAttrs.MTU = mtu
br := &netlink.Bridge{
LinkAttrs: netlink.LinkAttrs{
Name: brName,
MTU: mtu,
// Let kernel use default txqueuelen; leaving it unset
// means 0, and a zero-length TX queue messes up FIFO
// traffic shapers which use TX queue length as the
// default packet limit
TxQLen: -1,
},
LinkAttrs: linkAttrs,
}
if vlanFiltering {
br.VlanFiltering = &vlanFiltering
Expand Down

0 comments on commit 4ffccfd

Please sign in to comment.