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>
This commit is contained in:
parent
2ea3c6dd14
commit
44f01c2373
1 changed files with 2 additions and 16 deletions
|
|
@ -1,24 +1,10 @@
|
||||||
package netif
|
package netif
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/vishvananda/netlink"
|
"github.com/vishvananda/netlink"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setBridgeSTP(bridge string, enable bool) error {
|
func CreateBridge(name string, mtu int) 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 {
|
|
||||||
br := &netlink.Bridge{
|
br := &netlink.Bridge{
|
||||||
LinkAttrs: netlink.LinkAttrs{
|
LinkAttrs: netlink.LinkAttrs{
|
||||||
Name: name,
|
Name: name,
|
||||||
|
|
@ -34,7 +20,7 @@ func CreateBridge(name string, mtu int, stp bool) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return setBridgeSTP(name, stp)
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func BridgeSetMaster(iface, bridge string) error {
|
func BridgeSetMaster(iface, bridge string) error {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue