Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix BSD NULL (loopback) IPv6 protocol decode
The NULL linktype used by the loopback interface on BSD systems uses the PF_* value to indicate the next data type. For IPv6, the value of PF_INET6 was (amusingly) hardcoded to the value on linux systems and so decoding of IPv6 NULL packets has always been broken. The NULL linktype is unusual because it depends on runtime values: the protocol family, which differs by OS and the native host endianness for packing the protocol family. Deal with this by looking up the protocol family and endianness at runtime. Note this means that IPv6 BSD NULL packets cannot be decoded on other OS'es (the PF_INET6 value may differ) or on architectures of the opposite endianness. Reported in: #23 Thanks to 2b-as for reporting the problem!
- Loading branch information