mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
935d81f23d
Change the various config structs into one package and have a flatter structure for easier use. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
26 lines
574 B
Go
26 lines
574 B
Go
// +build linux
|
|
|
|
package network
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/docker/libcontainer/configs"
|
|
)
|
|
|
|
// Loopback is a network strategy that provides a basic loopback device
|
|
type Loopback struct {
|
|
}
|
|
|
|
func (l *Loopback) Create(n *configs.Network, nspid int, networkState *configs.NetworkState) error {
|
|
return nil
|
|
}
|
|
|
|
func (l *Loopback) Initialize(config *configs.Network, networkState *configs.NetworkState) error {
|
|
// Do not set the MTU on the loopback interface - use the default.
|
|
if err := InterfaceUp("lo"); err != nil {
|
|
return fmt.Errorf("lo up %s", err)
|
|
}
|
|
return nil
|
|
}
|