This fixes a buffer over-read discovered by Bhargava Shastry,
SecT/TU Berlin.
Add a test using the capture file supplied by the reporter(s), modified
so the capture file won't be rejected as an invalid capture.
with the tag '\summary:' for greping.
Remark: Currently some printers have no summary line.
Moreover:
Summarize all printers with a single line in INSTALL.txt
The purpose of this macro was to enable the file-by-file switch to NDO,
after which only tcpdump.c had a use of it and the definitions guarded
by it. Update tcpdump.c not to require them any more and dismiss the
unused definitions.
Some compilers appear to put some padding before the ospf6_un union, so
the OSPFv3 packets aren't dissected correctly. Pull the members of
that union into separate structures, and find the pointer to the OSPFv6
body by adding the header length to the pointer to the beginning of the
header.
And, as we require at least autoconf 2.61, and as autoconf 2.61 and
later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to
define the uintN_t and intN_t macros if the system doesn't define them
for us.
This lets us get rid of bitypes.h as well.
Have them take a netdissect_options * argument, and get the "no name
resolution" flag from it.
Move the declaration of dnaddr_string to addrtoname.h, along with the
other XXX-to-string routines.
Remove lots of $Header's and a few $Id's that all belong to the former
CVS repository of tcpdump itself. These keywords have been frozen since
the migration to git in late 2008.
For headers included in only one source file, put the header contents in
the source file in question, and get rid of a bunch of stuff from the
header not used in the source file.
* Update ospf6_print() to distinguish packet length and OSPFv3 data
length.
* Fix ospf6_print_lshdr(), ospf6_print_lsa() and ospf6_decode_v3() to
print the variable-sized part of DBDesc, LS-Upd and LS-Ack packets
with the declared length of the OSPFv3 data in mind.
* Implement as little LLS decoding in ospf6_print_lls() as necessary to
indicate and skip an LLS data block.
* Implement normal AT decoding in ospf6_decode_at().
* Add ospf6_decode_v3_trailer() to couple the above with ospf6_print().
This commit doesn't include a sample capture as the only existing RFC6506
implementation is not yet ready to serve as a reference.
* Add 3 more LS types and the M6-bit.
* Print multicast LS type and prefix option as deprecated.
* Remove needless forward declarations.
* Make ospf6_decode_v3() consider vflag for every packet type and raise
the margin from "> 0" to "> 1" because it is already "> 0" that far.
* Fix a message to refer to packet type instead of LS type.
* Remove irrelevant comment.
* Don't print unknown protocol version 2nd time.
For each decoder that has more than one instance of truncation signaling
and prints the same string in each instance make sure that the string is
declared as "static const char tstr[]" right after the initial includes
block. Where necessary, replace fputs(s, stdout) with equivalent
printf("%s", s).
Make sure all of them are declared const and most of them -- static.
Proper declaration of token arrays is a common review point for new code
that is based on existing decoders. Thus fix the issue at its root.
Check to make sure we haven't run past the end of the LSA by doing
length checks - and be a bit fussier about length checks. Do more
end-of-packet checks as well.
could be "long", for example, and probably *is* "long" on LP64
platforms), so you can't print it with "%u", but, in this particular
case, it's going to fit in a 32-bit quantity.
-share the grace and TE LSA printer with the OSPFv2 printer
-change to multiple line output (behind vflag)
-unambiguate datastructures such that the OSPFv3 printer can
include OSPFv2 header files.
appropriately, and that GNUmakefile and the MSVC++ project file define
it apppriately, as we do with libpcap, rather than defining it in
"interface.h".
Undo the rcsid-shuffling and addition of extra #includes, as we no
longer need to arrange that "interface.h" be included before using _U_
in an RCS ID or copyright.
use "_U_" in the definitions of "rcsid[]", to eliminate
complaints about those variables being unused;
move the definitions after the include of "interface.h", or add
an include of "interface.h", so that "_U_" is defined.
Include "config.h" before including "tcpdump-stdinc.h" in
"missing/datalinks.c".
compile with Sun C, as "interface.h" isn't being included before the
structures are being declared.
Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun
C to generate code that's safe with unaligned accesses, as
"__attribute__" is defined as a do-nothing macro with compilers that
don't support it.
Therefore, we get rid of that tag on the structures to which it was
added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch
16-bit and 32-bit big-endian quantities from packets. We also fix some
other references to multi-byte quantities to get rid of code that tries
to do unaligned loads on platforms that don't support them.
We also throw in a hack that makes those macros use
"__attribute__((packed))" on structures containing only one 16-bit or
32-bit integer to get the compiler to generate unaligned-safe code
rather than doing it by hand. (GCC on SPARC produces the same code that
doing it by hand does; I don't know if GCC on any other big-endian
strict-alignment processor generates better code for that case. On
little-endian processors, as "ntohs()" and "ntohl()" might be functions,
that might actually produce worse code.)
Fix some places to use "%u" rather than "%d" to print unsigned
quantities.
have dissectors include them rather than <netinet/ip.h> or
<netinet/ip_var.h>, if they actually need that stuff.
Put the declarations of the ICMP stuff directly into "print-icmp.c".
Remove all unnecessary includes of <netinet/ip*.h> files.
Copy the byte-order stuff from "nameser.h" into "tcp.h".
Hope I did not break anything. Portability on IPv4-only node needs checking,
I'll do this very soon. (sorry for rather jumbo commit)
XXx what is _FAVOR_BSD?