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

Function setInterfaceIP6

tailnet/test/integration/network.go:734–741  ·  view source on GitHub ↗

setInterfaceIP6 sets the IPv6 address on the given interface. It automatically adds a /64 subnet mask.

(netNS *os.File, ifaceName, ip string)

Source from the content-addressed store, hash-verified

732// setInterfaceIP6 sets the IPv6 address on the given interface. It automatically
733// adds a /64 subnet mask.
734func setInterfaceIP6(netNS *os.File, ifaceName, ip string) error {
735 _, err := commandInNetNS(netNS, "ip", []string{"addr", "add", ip + "/64", "dev", ifaceName}).Output()
736 if err != nil {
737 return xerrors.Errorf("set IP %q on interface %q in netns: %w", ip, ifaceName, wrapExitErr(err))
738 }
739
740 return nil
741}
742
743// setInterfaceUp brings the given interface up.
744func setInterfaceUp(netNS *os.File, ifaceName string) error {

Callers 1

SetupNetworkingMethod · 0.85

Calls 4

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

Tested by

no test coverage detected