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/icmp: wrong size for if-index in InterfaceIdent object #28530

Closed
uhei opened this issue Nov 1, 2018 · 3 comments
Closed

x/net/icmp: wrong size for if-index in InterfaceIdent object #28530

uhei opened this issue Nov 1, 2018 · 3 comments

Comments

@uhei
Copy link

uhei commented Nov 1, 2018

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

go1.11.1

Does this issue reproduce with the latest release?

Yes

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

darwin/amd64

What did you do?

Build a ICMP ExtendedEchoRequest message with typeInterfaceByIndex.

What did you expect to see?

if-index field being 4 bytes long (as defined in RFC7223 Sec 3 and RFC8335 Sec 2.1)

What did you see instead?

if-index field with 8 bytes

Will open a PR to fix this issue.

@gopherbot gopherbot added this to the Unreleased milestone Nov 1, 2018
uhei added a commit to uhei/net that referenced this issue Nov 1, 2018
RFC7223 Sec 3 [1] defines 32 bits for if-index.
RFC8335 Sec 2.1 [2] defines
"If the Interface Identification Object identifies the probed
interface by index, the length is equal to 8 and the payload contains
the if-index [RFC7223]."
The length includes 4 bytes header. => 4 bytes if-index

Issue has been reported with golang/go#28530.

[1]: https://tools.ietf.org/html/rfc7223
[2]: https://tools.ietf.org/html/rfc8335
@mikioh
Copy link
Contributor

mikioh commented Nov 2, 2018

@uhei,

if-index field being 4 bytes long (as defined in RFC7223 Sec 3 and RFC8335 Sec 2.1)

IIRC, the conclusion is as described in RFC 8335:

If the Interface Identification Object identifies the probed interface by index, the length is equal to 8 and the payload contains the if-index [RFC7223].

The protocol provides enough space for containing any representation of interface-index, practically from 32-bit to 64-bit integer for both classical and modern network control and management stuff.

@mikioh
Copy link
Contributor

mikioh commented Nov 2, 2018

Oh, sorry, you are correct. I've been misunderstood the format w/ mixing another discussion. Thanks for sending the fix.

uhei added a commit to uhei/net that referenced this issue Nov 2, 2018
RFC 7223, Section 3 defines 32 bits for if-index.
RFC 8335, Section 2.1 defines
"If the Interface Identification Object identifies the probed
interface by index, the length is equal to 8 and the payload contains
the if-index [RFC7223]."
The object should be comprised of a 4-byte object header and a 4-byte interface index.

Fixes golang/go#28530
@gopherbot
Copy link

Change https://golang.org/cl/146637 mentions this issue: icmp: fix InterfaceIdent.Index handling

@golang golang locked and limited conversation to collaborators Nov 2, 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

3 participants