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

x/net/ipv4: NewRawConn now gives operation not supported when it worked in previous versions #22150

Closed
kkirsche opened this issue Oct 5, 2017 · 6 comments

Comments

@kkirsche
Copy link
Contributor

kkirsche commented Oct 5, 2017

Please answer these questions before submitting your issue. Thanks!

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

go version go1.9.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/v832272/git/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8y/pj9zz4b12r37490xnlqb7gb13tt57z/T/go-build991994028=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

logrus.WithField("function", "Send()").Debugln("Create connection.")
conn, err := net.ListenPacket("ip4:icmp", "127.0.0.1")
if err != nil {
    logrus.WithError(err).WithField("function", "Send()").Errorln("Net ListenPacket connection error")
    return err
}
defer conn.Close()
 
rawConn, err := ipv4.NewRawConn(conn)
if err != nil {
    logrus.WithError(err).Errorln("Send() Error: Raw connection creation")
    return err
}

If possible, provide a recipe for reproducing the error.
1.) OS CentOS Linux release 7.3.1611 (Core)
2.) With or without SELinux enforcing

Working on a small app which encapsulates this

What did you expect to see?

No error and a new IPv4 raw connection as was supported in previous Golang builds. This only broke when recompiling an application that was last compiled 2017-07-13T11:34:03Z on the latest go version at that date.

What did you see instead?

ERRO[0030] Send() Error: Raw connection creation error="operation not supported"

on CentOS Linux release 7.3.1611 (Core) as the root user

@kkirsche
Copy link
Contributor Author

kkirsche commented Oct 5, 2017

https://github.com/kkirsche/golang_issue_22150/tree/master

This demonstrates the issue on 1.9.1 in the bin directory and not on 1.8.4 in the bin directory. Binaries for multiple distros included. Build makefile included

@ianlancetaylor ianlancetaylor changed the title net.ipv4.NewRawConn now gives operation not supported when it worked in previous versions x/net/ipv4: NewRawConn now gives operation not supported when it worked in previous versions Oct 5, 2017
@gopherbot gopherbot added this to the Unreleased milestone Oct 5, 2017
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 5, 2017
@ianlancetaylor
Copy link
Contributor

CC @mikioh

@mikioh
Copy link
Contributor

mikioh commented Oct 5, 2017

Go 1.9 or above requires at least the commit cabdc3af38bdc364f9b1ae4e0d8e4d51ec53f7e1 on ipv4 package. Unfortunately, the previous revision on x/net doesn't work with Go 1.9 or above. Can you please tell us which revision of x/net you are using, and what happens when you update your local snapshot of x/net?

@kkirsche
Copy link
Contributor Author

kkirsche commented Oct 5, 2017

I would guess this is the issue then. I'm in the process of updating my x/* dependencies and will update once I recompile.

@kkirsche
Copy link
Contributor Author

kkirsche commented Oct 5, 2017

This fixed it. It was due to an outdated x/net package. Sorry about this and thank you for the quick assistance.

@kkirsche kkirsche closed this as completed Oct 5, 2017
@mikioh
Copy link
Contributor

mikioh commented Jan 15, 2018

Dup of #19209.

@mikioh mikioh removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 6, 2018
@golang golang locked and limited conversation to collaborators Feb 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants