setInterfaceIP6 sets the IPv6 address on the given interface. It automatically adds a /64 subnet mask.
(netNS *os.File, ifaceName, ip string)
| 732 | // setInterfaceIP6 sets the IPv6 address on the given interface. It automatically |
| 733 | // adds a /64 subnet mask. |
| 734 | func 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. |
| 744 | func setInterfaceUp(netNS *os.File, ifaceName string) error { |
no test coverage detected