func deleteBridge(bridge *Bridge) error { if err := netlink.NetworkLinkDown(bridge.iface); err != nil { return err } if err := netlink.DeleteBridge(bridge.name); err != nil { return err } return nil }
func (Bridge) Destroy(bridge string) error { netlinkMu.Lock() defer netlinkMu.Unlock() intfs, err := net.Interfaces() if err != nil { return err } for _, i := range intfs { if i.Name == bridge { return netlink.DeleteBridge(bridge) } } return nil }