-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sys/linux: add NDISC packet formats to vnet.txt #992
Conversation
Hi Dan, While I am looking at the actual descriptions, you also need to generate *.const files, please see:
and then add all changed files to this PR. |
sys/linux/vnet.txt
Outdated
# https://tools.ietf.org/html/rfc4861#section-4.6 | ||
icmpv6_ndisc_option { | ||
option_type flags[icmpv6_ndisc_option_types, int8] | ||
length int8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not look auto-formatted.
make generate
will take care of formatting, or make format_sys
will do it separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be bytesize[data, int8]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or bytesize[parent, int8]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think bytesize8[data, int8
bytesize8[parent, int8]
is what we want. The length calculation for NDISC options is similar to that of the Hop-by-Hop options.
EDIT: s/data/parent/
sys/linux/vnet.txt
Outdated
type const[NDISC_NEIGHBOR_SOLICITATION, int8] | ||
code const[0, int8] | ||
csum csum[parent, pseudo, IPPROTO_ICMPV6, int16be] | ||
unused int32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's unused we could use const[0, int32]
. Not that it's super important, but will fuzzer to not spend time mutating this a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 makes sense.
7a2afb9
to
2c051f6
Compare
@dvyukov thanks! Formatting etc now |
Add the basic NDISC (RFC 4861) packet formats to sys/linux/vnet.txt.
2c051f6
to
aa8e524
Compare
@@ -339,6 +339,21 @@ NEXTHDR_ICMP = 58 | |||
NEXTHDR_MOBILITY = 135 | |||
NEXTHDR_NONE = 59 | |||
NEXTHDR_ROUTING = 43 | |||
ND_OPT_SOURCE_LL_ADDR = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These constants are all just a single byte, so they'll be the same for all architectures regardless of endianness. Might be nice to add a vnet_any.const
for constants like these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files are all auto-generated, so there is no cost in that duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There is a problem with go fmt -- it changed format in between 1.10 and 1.11 (golang/go#25161) which creates problems. |
👍 yeah Gentoo uses 1.11.5. |
Add the basic NDISC (RFC 4861) packet formats to sys/linux/vnet.txt.