MCPcopy Index your code
hub / github.com/coder/coder / setInterfaceUp

Function setInterfaceUp

tailnet/test/integration/network.go:744–751  ·  view source on GitHub ↗

setInterfaceUp brings the given interface up.

(netNS *os.File, ifaceName string)

Source from the content-addressed store, hash-verified

742
743// setInterfaceUp brings the given interface up.
744func setInterfaceUp(netNS *os.File, ifaceName string) error {
745 _, err := commandInNetNS(netNS, "ip", []string{"link", "set", ifaceName, "up"}).Output()
746 if err != nil {
747 return xerrors.Errorf("bring up interface %q in netns: %w", ifaceName, wrapExitErr(err))
748 }
749
750 return nil
751}
752
753// addRouteInNetNS adds a route to the given network namespace.
754func addRouteInNetNS(netNS *os.File, route []string) error {

Callers 3

createFakeInternetFunction · 0.85
SetupNetworkingMethod · 0.85
joinBridgeFunction · 0.85

Calls 4

commandInNetNSFunction · 0.85
wrapExitErrFunction · 0.85
OutputMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected