golang/go

x/net/ipv4: wrong endianness in IP header on darwin-amd64

Open

#32.118 geöffnet am 17. Mai 2019

Auf GitHub ansehen
 (6 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (19.008 Forks)batch import
NeedsInvestigationOS-Darwinhelp wanted

Repository-Metriken

Stars
 (133.883 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Does this issue reproduce with the latest release?

Yes

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

What did you do?

marshall IPv4 IP header with x/net/ipv4/header, but I got little-endian instead of big-endian.

What did you expect to see?

Got big-endian IP header len.

What did you see instead?

little-endian

Looking at By looking at the code https://github.com/golang/net/blob/master/ipv4/header.go#L71., for darwin, 32bit/64bit os should have a different conversion. Darwin amd64 is little-endian, it should convert.

Contributor Guide