summaryrefslogtreecommitdiff
path: root/print-icmp6.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-07-09 09:42:17 -0700
committerGuy Harris <guy@alum.mit.edu>2018-07-09 09:42:33 -0700
commit154b32ede55d03fb0e3c19ad45349bdb793b9e9f (patch)
treee72dd8d2869e32669decdc605f2951d53e153661 /print-icmp6.c
parent57cb8fa2c85cec4b7ac80577bc093c0003e11e3b (diff)
downloadtcpdump-154b32ede55d03fb0e3c19ad45349bdb793b9e9f.tar.gz
Clean up dissection.
Don't use pointers to anything other than octets; there is no guarantee that the L2TP packet is aligned on a 2-byte or 4-byte boundary, and there is no need to pretend that we have pointers to aligned values - we're using the EXTRACT_ macros, which will fetch multi-byte integral values regardless of the alignment of the pointer. This also fixes some cases where we were advancing 2 bytes after processing a 1-byte field - we were incrementing a uint16_t * by 1, which means advancing it by 2 bytes, and we're now incrementing the uint8_t * by 1. Don't cast a 4-byte integer to u_long - EXTRACT_BE_U_4() is guaranteed to return something printable with %u. Don't fetch fields dividded into "high" and "low" portions 2 bytes at a time and reassemble them; the only reason they're divided into "high" and "low" partitions in the ASCII-art diagrams in RFC 2661 is that those diagrams tend to show packets in the form of 32-bit words, and those fields aren't aligned on 32-bit word boundaries, so we can just fetch those fields with EXTRACT_BE_U_4(). Don't print a sequence of AVPs by recursion; iterate instead. Add some RFC numbers while we're at it.
Diffstat (limited to 'print-icmp6.c')
0 files changed, 0 insertions, 0 deletions