Commit Graph

31 Commits

Author SHA1 Message Date
Guy Harris
cbddb98484 CVE-2017-13002/AODV: Add some missing bounds checks.
In aodv_extension() do a bounds check on the extension header before we
look at it.

This fixes a buffer over-read discovered by Kamil Frankowicz.

Add a test using the capture file supplied by the reporter(s).

While we're at it, add the RFC number, and check the validity of the
length for the Hello extension.
2017-09-13 12:25:44 +01:00
Francois-Xavier Le Bail
11d3a01319 Move the printer summaries from INSTALL.txt to each printer
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
2016-08-14 17:03:43 +02:00
Guy Harris
11f73ad248 Don't require IPv6 library support in order to support IPv6 addresses.
Have our own routines to convert between IPv4/IPv6 addresses and
strings; that helps if, for example, we want to build binary versions of
tcpdump for Windows that can run both on NT 5 (W2K/WXP), which doesn't
have inet_ntop() or inet_pton(), and NT 6 (Vista/7/8/10), which do.  It
also means that we don't require IPv6 library support on UN*X to print
addresses (if somebody wants to build tcpdump for older UN*Xes lacking
IPv6 support in the system library or in add-on libraries).

Get rid of files in the missing directory that we don't need, and
various no-longer-necessary autoconf tests.
2015-09-17 14:56:44 -07:00
Francois-Xavier Le Bail
99c91c3aec Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'
Get the full log via: git log --follow netdissect-stdinc.h
2015-09-10 08:50:40 +02:00
Francois-Xavier Le Bail
b638c78b40 Remove obsolete comments 2015-09-07 15:01:46 +02:00
Francois-Xavier Le Bail
c1c3c77463 Printers must include 'netdissect.h', not 'interface.h' 2015-09-05 23:35:58 +02:00
Guy Harris
69cb46af91 Fix a bunch of de-constifications. 2015-04-26 17:24:42 -07:00
Denis Ovsienko
38700c7f24 dismiss NETDISSECT_REWORKED macro
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.
2015-03-22 10:06:15 +00:00
Guy Harris
3f5693a2bb Report a too-long unreachable destination list.
Running out of packet length before running out of unreachable
destinations is an error; report it as such.

Don't worry about leftover data past the end of the list of unreachable
destinations.
2014-11-12 01:09:27 -08:00
Guy Harris
54d2912c19 Not using offsetof() any more, so no need for <stddef.h>. 2014-11-11 19:18:12 -08:00
Guy Harris
e302ff0e4a Further cleanups.
Use ND_TCHECK() rather than home-brew bounds checks.  Do simpler length
checks.

Let i be the length of the actual remaining packet data; use ND_TCHECK()
inside loops that iterate over the remaining data.

Let the printers for particular message types cast the raw data pointer
to a pointer of the appropriate type, rather than passing two pointers,
with different types, to the same data.
2014-11-11 19:05:48 -08:00
Guy Harris
3e8a443c36 Clean up error message printing.
Have "struct aodv_rerr" just be the header, not including the actual
destinations.

Simplify the logic somewhat, and make it similar in the print routines
for the three types of error messages.
2014-11-11 18:37:35 -08:00
Guy Harris
ab4e52b94a Add initial bounds check, get rid of union aodv.
Fetch the type field without using a structure, and check to make sure
it's not past the end of the packet.

Pass to each dissection routine a pointer to the appropriate message
type structure, rather than a pointer to a union of all the message type
structures.
2014-11-11 17:24:12 -08:00
Guy Harris
a2633f2f21 More fixes for uint8_t being shorter than u_int8_t.
Fix a typo while we're at it.
2014-04-23 11:53:22 -07:00
Guy Harris
ed85e20e4d u_intN_t is dead, long live uintN_t.
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.
2014-04-23 00:20:40 -07:00
Guy Harris
1cde6435df Netdissectify the to-name resolution routines.
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.
2014-04-04 00:43:46 -07:00
Denis Ovsienko
b6303af682 NDOize AODV, IPv4 and SCTP decoders 2014-03-26 15:49:27 +04:00
Guy Harris
147a3fdaf7 The interval in an AODV HELLO extension is not aligned on a 4-byte boundary. 2014-01-19 19:19:22 -08:00
Denis Ovsienko
fe3253b9b8 remove tcpdump's own CVS keywords
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.
2014-01-03 00:59:08 +04:00
Guy Harris
27d428c0a1 Pull a bunch of headers into the only source file that includes them.
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.
2013-12-30 22:52:15 -08:00
guy
b340e34b6a Add bounds checking. 2004-03-24 00:30:19 +00:00
guy
bbc1cfa669 Have the configure script arrange that the Makefile define _U_
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.
2003-11-16 09:36:07 +00:00
guy
3824a6c041 From Neil Spring:
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".
2003-11-15 00:39:12 +00:00
guy
f875106903 The now-expired draft-perkins-aodv6-01 specified a different order for
fields in most of the AODV messages when used with V6; print those
correctly.

Get rid of some "v6" tags that weren't there before my previous checkin.
2003-09-13 01:34:42 +00:00
guy
485a2e2ed0 Use %[l]u, not %[l]d, to print unsigned quantities. 2003-09-12 22:16:53 +00:00
guy
93875de9dc As itojun said, u_int32_t can be long or int, depending on the platform. 2003-09-12 22:10:42 +00:00
guy
cd8e2f4ca0 Updates from Bruce Simpson:
Fix numerous bugs in my AODV submission, red faces all round,
	mainly due to misunderstanding of EXTRACT_STRING() macro
	arguments (because these are macros, type checking didn't
	happen).

	AODV HELLO extensions are now correctly printed.

	The code is closer to FreeBSD's style guidelines.

Don't use "u_char" and "u_long", use "u_int8_t" and "u_int32_t".
"u_long" is definitely wrong as it's 64 bits on some platforms; "u_char"
is safe, but the official tcpdump style uses "u_int8_t".

At least according to the (long-since-expired) draft-perkins-aodv6-01,
the V6 AODV messages have different message type values from the V4 ones
in draft-ietf-manet-aodv-13.  However, draft-ietf-manet-aodv-13 says
that the only differences are in the addresses; we support both.

Clean up the way we tell the AODV6 dissector that we're running atop
IPv6 a bit.

Use "udpipaddr_print()" if we're printing AODV packets as a result of
saying "anything that matches this filter is AODV", rather than doing it
ourselves under the assumption that it's running over IPv4.
2003-09-12 22:05:56 +00:00
guy
c6d3ff424a Squelch a compiler warning. 2003-09-06 22:16:56 +00:00
itojun
f614688dcd u_int32_t is long or int depending on platform 2003-08-13 02:23:07 +00:00
risso
0f29a7b583 Modified the included files in order to make print-aodv compile under Windows as well. 2003-08-07 11:31:42 +00:00
guy
073489bc82 From Bruce M. Simpson <bms@spc.org>: RFC 3561 AODV support. 2003-08-06 06:49:38 +00:00