Fix txqueuelen being accidentally set to zero

TxQLen was unintentionally set to 0 due to a struct literal.

Signed-off-by: Gudmundur Bjarni Olafsson <gudmundur.bjarni@gmail.com>
This commit is contained in:
Gudmundur Bjarni Olafsson
2024-09-23 13:04:24 +02:00
committed by Casey Callendrello
parent c11ed48733
commit 3a49cff1f6
24 changed files with 155 additions and 155 deletions

View File

@ -108,13 +108,13 @@ func makeTCPClientInNS(netns string, address string, port int, numBytes int) {
}
func createVeth(hostNs ns.NetNS, hostVethIfName string, containerNs ns.NetNS, containerVethIfName string, hostIP []byte, containerIP []byte, hostIfaceMTU int) {
linkAttrs := netlink.NewLinkAttrs()
linkAttrs.Name = hostVethIfName
linkAttrs.Flags = net.FlagUp
linkAttrs.MTU = hostIfaceMTU
vethDeviceRequest := &netlink.Veth{
LinkAttrs: netlink.LinkAttrs{
Name: hostVethIfName,
Flags: net.FlagUp,
MTU: hostIfaceMTU,
},
PeerName: containerVethIfName,
LinkAttrs: linkAttrs,
PeerName: containerVethIfName,
}
err := hostNs.Do(func(_ ns.NetNS) error {
@ -195,12 +195,12 @@ func createVeth(hostNs ns.NetNS, hostVethIfName string, containerNs ns.NetNS, co
}
func createVethInOneNs(netNS ns.NetNS, vethName, peerName string) {
linkAttrs := netlink.NewLinkAttrs()
linkAttrs.Name = vethName
linkAttrs.Flags = net.FlagUp
vethDeviceRequest := &netlink.Veth{
LinkAttrs: netlink.LinkAttrs{
Name: vethName,
Flags: net.FlagUp,
},
PeerName: peerName,
LinkAttrs: linkAttrs,
PeerName: peerName,
}
err := netNS.Do(func(_ ns.NetNS) error {
@ -224,13 +224,13 @@ func createMacvlan(netNS ns.NetNS, master, macvlanName string) {
return fmt.Errorf("failed to lookup master %q: %v", master, err)
}
linkAttrs := netlink.NewLinkAttrs()
linkAttrs.MTU = m.Attrs().MTU
linkAttrs.Name = macvlanName
linkAttrs.ParentIndex = m.Attrs().Index
macvlanDeviceRequest := &netlink.Macvlan{
LinkAttrs: netlink.LinkAttrs{
MTU: m.Attrs().MTU,
Name: macvlanName,
ParentIndex: m.Attrs().Index,
},
Mode: netlink.MACVLAN_MODE_BRIDGE,
LinkAttrs: linkAttrs,
Mode: netlink.MACVLAN_MODE_BRIDGE,
}
if err = netlink.LinkAdd(macvlanDeviceRequest); err != nil {