setInterfaceUp brings the given interface up.
(netNS *os.File, ifaceName string)
| 742 | |
| 743 | // setInterfaceUp brings the given interface up. |
| 744 | func 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. |
| 754 | func addRouteInNetNS(netNS *os.File, route []string) error { |
no test coverage detected