dc31d5c15f
The switchNetns function was only defined for linux (dialer_netns.go, build tag linux && !android) and android (dialer_android.go, stub). This left darwin, freebsd, openbsd, windows, and other platforms with an undefined symbol at dialer.go:55. Add no-op stubs to all remaining platform files so the dialer package compiles on every GOOS.
22 lines
466 B
Go
22 lines
466 B
Go
package dialer
|
|
|
|
import (
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func bindDevice(network, address string, fd uintptr, ifceName string) error {
|
|
return nil
|
|
}
|
|
|
|
func setMark(fd uintptr, mark int) error {
|
|
if mark == 0 {
|
|
return nil
|
|
}
|
|
return unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_RTABLE, mark)
|
|
}
|
|
|
|
// switchNetns is a no-op stub — network namespace switching is a Linux-only feature.
|
|
func switchNetns(name string) (restore func(), err error) {
|
|
return nil, nil
|
|
}
|