summaryrefslogtreecommitdiff
path: root/sbin/newfs_ext2fs
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-12-02 22:07:21 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-12-02 22:07:21 +0000
commit238eefc523062a817404549c6085da4eca45e2a2 (patch)
treeb137bfe5dfc5ed4c1fea641a45db05dcdcf6dcd5 /sbin/newfs_ext2fs
parent716c19fbda8645e16773fdb2dfb7cc66c5504f9d (diff)
rewrite dhcpv6 parsing so it follows the rfc, not an incompat draft.
it looks like this code was using draft-ietf-dhc-dhcpv6-14 from 1999. there were 27 drafts, and by the time it got to draft 23 and the rfc it was significantly different. this code for draft 14 cannot handle actual dhcpv6 messages. im kind of surprised (disappointed?) that noone noticed before. i only noticed cos the code was segfaulting on sparc64, and when i tried to fix it the resulting messages looked nothing like what stock tcpdump produced. the main difference between the early drafts and what ended up in the rfc is that the base dhcpv6 messages in early drafts were large structure with a lot of fixed fields, while the rfc settled on a 4 byte header that contains a 1 byte message type and a 3 byte transaction id. the rest of the messages are built from dhcp options fields. this cuts all the old handling out, and fixes the fault in the options handling by using EXTRACT_16BITS to get at the code and length fields instead of using ntohs. dhcpv6 explicitly states that it does not align options, so this is necessary to avoid faults on strict alignment archs anyway. no options are pretty printed at the moment, you just get a numeric type, a length, and a hexdump of the value. this is still better than the garbage that the draft parsing produced. if someone is interested in making this easier to read, it would be a straightforward and well contained project to better handle option printing. ok deraadt@
Diffstat (limited to 'sbin/newfs_ext2fs')
0 files changed, 0 insertions, 0 deletions