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: cannot obtain IPv6 base header from IPv6 socket because it's designed to behave like so inside the kernel #18034

Closed
joy4eg opened this issue Nov 23, 2016 · 2 comments

Comments

Projects
None yet
5 participants
@joy4eg
Copy link

commented Nov 23, 2016

Please answer these questions before submitting your issue. Thanks!

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

go version go1.6.3 linux/amd64

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

Fedora 24
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/userx/work/golang"
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

What did you do?

Link for test program - https://play.golang.org/p/b5f1aRBBUn
Example output:

2016/11/23 21:04:08 ----------- ICMPv4 reply (84 bytes) ----------->>>
2016/11/23 21:04:08
00000000  45 00 00 54 00 00 00 00  31 01 cd 1a 08 08 08 08  |E..T....1.......|
00000010  ac 10 00 6f 00 00 3a 02  17 4d 00 01 48 49 20 54  |...o..:..M..HI T|
00000020  68 65 72 65 21 48 49 20  54 68 65 72 65 21 48 49  |here!HI There!HI|
00000030  20 54 68 65 72 65 21 48  49 20 54 68 65 72 65 21  | There!HI There!|
00000040  48 49 20 54 68 65 72 65  21 48 49 20 54 68 65 72  |HI There!HI Ther|
00000050  65 21 48 49                                       |e!HI|
2016/11/23 21:04:08 <<<-------- ICMPv4 reply (84 bytes) --------------
2016/11/23 21:04:08 IPv4 header: ver=4 hdrlen=20 tos=0x0 totallen=84 id=0x0 flags=0x0 fragoff=0x0 ttl=49 proto=1 cksum=0xcd1a src=8.8.8.8 dst=172.16.0.111
2016/11/23 21:04:08 ----------- ICMPv6 reply (64 bytes) ----------->>>
2016/11/23 21:04:08
00000000  81 00 a7 e5 17 4d 00 01  48 49 20 54 68 65 72 65  |.....M..HI There|
00000010  21 48 49 20 54 68 65 72  65 21 48 49 20 54 68 65  |!HI There!HI The|
00000020  72 65 21 48 49 20 54 68  65 72 65 21 48 49 20 54  |re!HI There!HI T|
00000030  68 65 72 65 21 48 49 20  54 68 65 72 65 21 48 49  |here!HI There!HI|
2016/11/23 21:04:08 <<<-------- ICMPv6 reply (64 bytes) --------------

What did you expect to see?

I'm expect to see the IPv6 header in ICMPv6 response (like in v4 version)
I need this feature because i want to get the HopLimit (TTL) from a response and keep it for later use.

What did you see instead?

Only ICMPv6 message present, without IPv6 header

@quentinmit quentinmit added this to the Unreleased milestone Nov 23, 2016

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Nov 23, 2016

CC @mikioh

@mikioh mikioh changed the title x/net/icmp: cannot obtain IPv6 header from ICMPv6 socket net: cannot obtain IPv6 base header from IPv6 socket because it's designed to behave like so inside the kernel Nov 23, 2016

@mikioh

This comment has been minimized.

Copy link
Contributor

commented Nov 23, 2016

@ianlancetaylor,

This is not related to x/net/{ipv4,ipv6,icmp} packages.

@joy4eg,

Please take a look at online manual on your target node, e.g., man ipv6 and raw on Linux, and refer to RFCs mentioned in https://godoc.org/golang.org/x/net/ipv6. They describe the behavior and its rationale. When more questions come to your mind, see https://github.com/golang/go/wiki/Questions.

@mikioh mikioh closed this Nov 23, 2016

@mikioh mikioh removed this from the Unreleased milestone Nov 23, 2016

@golang golang locked and limited conversation to collaborators Nov 24, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.