feature-14 #17
1 changed files with 2 additions and 16 deletions
f-14: clean: remove not used setBridgeSTP
All checks were successful
Pre Release Workflow / set-release-target (push) Successful in 1s
Pre Release Workflow / build (agent, amd64, linux) (push) Successful in 1m26s
Pre Release Workflow / build (db, amd64, linux) (push) Successful in 1m33s
Pre Release Workflow / build (metacli, amd64, linux) (push) Successful in 1m31s
Pre Release Workflow / build (metadata, amd64, linux) (push) Successful in 1m29s
Pre Release Workflow / build (vpc, amd64, linux) (push) Successful in 1m31s
Pre Release Workflow / prerelease (push) Successful in 11s
All checks were successful
Pre Release Workflow / set-release-target (push) Successful in 1s
Pre Release Workflow / build (agent, amd64, linux) (push) Successful in 1m26s
Pre Release Workflow / build (db, amd64, linux) (push) Successful in 1m33s
Pre Release Workflow / build (metacli, amd64, linux) (push) Successful in 1m31s
Pre Release Workflow / build (metadata, amd64, linux) (push) Successful in 1m29s
Pre Release Workflow / build (vpc, amd64, linux) (push) Successful in 1m31s
Pre Release Workflow / prerelease (push) Successful in 11s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
commit
44f01c2373
|
|
@ -1,24 +1,10 @@
|
|||
package netif
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/vishvananda/netlink"
|
||||
)
|
||||
|
||||
func setBridgeSTP(bridge string, enable bool) error {
|
||||
path := fmt.Sprintf("/sys/class/net/%s/bridge/stp_state", bridge)
|
||||
|
||||
val := "0"
|
||||
if enable {
|
||||
val = "1"
|
||||
}
|
||||
|
||||
return os.WriteFile(path, []byte(val), 0644)
|
||||
}
|
||||
|
||||
func CreateBridge(name string, mtu int, stp bool) error {
|
||||
func CreateBridge(name string, mtu int) error {
|
||||
br := &netlink.Bridge{
|
||||
LinkAttrs: netlink.LinkAttrs{
|
||||
Name: name,
|
||||
|
|
@ -34,7 +20,7 @@ func CreateBridge(name string, mtu int, stp bool) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return setBridgeSTP(name, stp)
|
||||
return nil
|
||||
}
|
||||
|
||||
func BridgeSetMaster(iface, bridge string) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue