x/net/ipv4: missing a way to parse Linux packets on Darwin #43386
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 did you do?
I captured TCP/IPv4 packets on Linux, saved them to files to be used in unit tests. Then I tried running unit tests on macOS and they failed. This was because of a hard-coded OS detection in ipv4.Header.Parse.
What did you expect to see?
I would expect to have a way to specify packet OS when I want to parse the packet. This feature would make the code of the library cleaner and less platform dependent. Currently, even tests are not clean (by having switch/case) and depend on the OS they are being run on.
What did you see instead?
I'm not able to use ipv4.ParseHeader with pre-saved files on a different platform.
The text was updated successfully, but these errors were encountered: