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

Function addRouteInNetNS

tailnet/test/integration/network.go:754–761  ·  view source on GitHub ↗

addRouteInNetNS adds a route to the given network namespace.

(netNS *os.File, route []string)

Source from the content-addressed store, hash-verified

752
753// addRouteInNetNS adds a route to the given network namespace.
754func addRouteInNetNS(netNS *os.File, route []string) error {
755 _, err := commandInNetNS(netNS, "ip", append([]string{"route", "add"}, route...)).Output()
756 if err != nil {
757 return xerrors.Errorf("add route %q in netns: %w", route, wrapExitErr(err))
758 }
759
760 return nil
761}
762
763// prepareSTUNServer creates a STUN server networking spec in a network
764// namespace and joins it to the bridge. It also sets up the DERP map for the

Callers 2

createFakeInternetFunction · 0.85
SetupNetworkingMethod · 0.85

Calls 4

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

Tested by

no test coverage detected