Skip to content

x/net/ipv4: missing a way to parse Linux packets on Darwin  #43386

@denisvmedia

Description

@denisvmedia

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

$ go version
go version go1.15 darwin/amd64

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Darwin

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions