Skip to content

on "darwin", "dragonfly", "freebsd", "netbsd" the ip total length and frag off needs to be host byte order #150

@nhooyr

Description

@nhooyr

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man4/ip.4.html

go down to raw ip sockets and the line "Note that the ip_off and ip_len fields are in host byte order."

This doesn't happen in gopacket and I was very confused for a while.

In the ipv4 package it is done there

https://github.com/golang/net/blob/master/ipv4/header.go (line 75)

Its trivial to fix in your own code but it would be nice to have it in gopacket.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions