Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net.ListenIP: failed when network is ip:50 #49612

Closed
WingPig99 opened this issue Nov 16, 2021 · 5 comments
Closed

net.ListenIP: failed when network is ip:50 #49612

WingPig99 opened this issue Nov 16, 2021 · 5 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@WingPig99
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.17.2 darwin/amd64

Does this issue reproduce with the latest release?

No, haven't try.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/--/Library/Caches/go-build"
GOENV="/Users/--/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/--/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/--/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.17.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.17.2/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sl/1s293gd924l4pw9jtqw37q0c0000gn/T/go-build1496403415=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Try to listen raw IP packet using net.ListenIP("ip:50", address), see https://play.golang.org/p/iW558sJvrWq

What did you expect to see?

Run succeed.

What did you see instead?

socket: operation not supported on socket

@seankhliao
Copy link
Member

do you have the appropriate permissions? try running as root

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 16, 2021
@WingPig99
Copy link
Author

Thanks, Sean. I tried with root permission, still has the problem on macOS. It works on Ubuntu 20.04.3.

sudo go run test.go
2021/11/16 15:34:01 Listen IP failed listen ip:50 127.0.0.1: socket: operation not supported on socket

@seankhliao
Copy link
Member

I think this is due to darwin-xnu only allowing the kernel to handle IPSec, though it's difficult to find documentation for this

@WingPig99
Copy link
Author

WingPig99 commented Nov 18, 2021

@seankhliao Thank your for your reply. Should I close this comment or let it to wait further information?

@seankhliao
Copy link
Member

Given that there's nothing Go can do about this I think it can be closed

@golang golang locked and limited conversation to collaborators Nov 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants