//go:build !darwin package main import ( "context" "fmt" "net" ) // Everywhere except macOS, interface binding is not the answer to anything this command has met, so asking // for it is refused rather than silently ignored. A silent no op would let an operator set the variable on // the Linux node, watch nothing change, and conclude the setting does not work anywhere. // // Linux has SO_BINDTODEVICE for the same purpose and it needs CAP_NET_RAW, so if a Linux node ever grows // the same scoped route problem this is the file that gains the implementation. func bindToInterface(name string) (func(ctx context.Context, network, addr string) (net.Conn, error), error) { if name == "" { return nil, nil } return nil, fmt.Errorf("binding a socket to interface %q is implemented for macOS only on this command", name) }