addRouteInNetNS adds a route to the given network namespace.
(netNS *os.File, route []string)
| 752 | |
| 753 | // addRouteInNetNS adds a route to the given network namespace. |
| 754 | func 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 |
no test coverage detected