x/net/icmp: PacketConn.ReadFrom on an unprivileged PacketConn on darwin returns the entire IP packet #47369
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
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
)?go env
OutputWhat did you do?
https://play.golang.org/p/oNQqxusHBf1
The program sends a ping first with a privileged socket and then with an unprivileged socket.
What did you expect to see?
I expect to see the returned ICMP payloads to be fairly similar. On Linux, they are.
Linux:
What did you see instead?
The read from the unprivileged socket on Darwin included the IP header before the ICMP header.
Darwin:
This seems due to the check in https://cs.opensource.google/go/x/net/+/853a4619:icmp/endpoint.go;l=54 which (apparently) doesn't apply to unprivileged sockets.
The text was updated successfully, but these errors were encountered: