Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkt.hrl contains Linux specific values #23

Closed
2b-as opened this issue Jan 29, 2015 · 1 comment
Closed

pkt.hrl contains Linux specific values #23

2b-as opened this issue Jan 29, 2015 · 1 comment

Comments

@2b-as
Copy link

2b-as commented Jan 29, 2015

Values in pkt.hrl are hardcoded to their Linux values (e.g. -define(PF_INET6, 10)), but these values differ from OS to OS.

msantos added a commit that referenced this issue Jan 29, 2015
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!
@msantos
Copy link
Owner

msantos commented Jan 29, 2015

Thanks! I pushed a fix. I've left the value of PF_INET6 in the header for now. Nothing should be using it but I still need to check.

@msantos msantos closed this as completed Jan 29, 2015
msantos added a commit that referenced this issue Jan 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants