golang/go

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

Open

#32.118 aperta il 17 mag 2019

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)Go (19.008 fork)batch import
NeedsInvestigationOS-Darwinhelp wanted

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor