raw
raw copied to clipboard
Parse the BPF header for length
Instead of hard-coding the length of the BPF header, this pull-request casts the header into a Go struct and gets the length of the header from that struct. This neatly solves a problem where the header length varies not only with the OS, but also by the architecture.
This solution works without further hacks on FreeBSD and OpenBSD. I haven't had time to test this on NetBSD as raw doesn't build there yet due to the structure of its timeval.
Apologies for the delay. Could you please rebase this on master as well? Thanks.