summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SFLOW: Fix bounds checkingtcpdump-4.4Francois-Xavier Le Bail2015-05-201-3/+52
|
* Fix the pointer tests in the non-ndoified TTEST2() macro as well.Guy Harris2015-03-021-2/+14
|
* AC_TYPE_UINTPTR_T requires a newer autoconf.Guy Harris2015-03-021-1/+1
|
* C compilers can, and some do, optimize away pointer underflow checks.Guy Harris2015-03-024-7410/+3289
| | | | | Cast the pointers to uintptr_t; use AC_TYPE_UINTPTR_T to get uintptr_t defined on older platforms that don't define it themselves.
* Don't run past the snaplength when printing a packet with a too-short LI.Guy Harris2015-03-011-1/+1
| | | | Fixes GitHub issue #437.
* Check not just the capture length but the on-the-network length.tcpdump_4.4Guy Harris2015-01-061-6/+5
|
* Don't run past the snapshot length when doing hex/ASCII dumps.Guy Harris2015-01-062-0/+17
|
* Do bounds checking when unescaping PPP.Guy Harris2014-11-191-8/+11
| | | | Clean up a const issue while we're at it.
* The interval in an AODV HELLO extension is not aligned on a 4-byte boundary.Guy Harris2014-11-191-2/+3
|
* Don't subtract the UDP header size from the length twice.Guy Harris2014-11-191-4/+2
|
* Use the length field in the UDP header.Guy Harris2014-11-192-13/+30
| | | | | | If it's less than the length of the IP payload, use it as the size of the UDP packet. If it's greater than the length of the IP payload, and we're not dissecting the payload, report the length as bad.
* Report a too-long unreachable destination list.Guy Harris2014-11-191-12/+15
| | | | | | | | 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.
* Not using offsetof() any more, so no need for <stddef.h>.Guy Harris2014-11-191-1/+0
|
* Further cleanups.Guy Harris2014-11-191-136/+126
| | | | | | | | | | | | 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.
* Clean up error message printing.Guy Harris2014-11-192-43/+47
| | | | | | | | 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.
* Add initial bounds check, get rid of union aodv.Guy Harris2014-11-192-144/+130
| | | | | | | | | 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.
* Do more bounds checking and length checking.Guy Harris2014-11-191-15/+43
| | | | | | | Don't run past the end of the captured data, and don't run past the end of the packet (i.e., don't make the length variable go negative). Also, stop dissecting if the message length isn't valid.
* Fix potential (but not actual) buffer overflow risk.Guy Harris2013-07-311-1/+1
| | | | | | | | | | | | | The line buffer is 256 bytes long, so the name subfield in the line can't be bigger than 256 bytes, but 1) somebody could make the line buffer bigger and 2) this way the format item and buffer size match so we'll do it anyway.
* Fix possible buffer overflow while doing sscanf()Jakub Zawadzki2013-07-311-1/+1
| | | | | MAXHOSTNAMELEN + 100 is only 164 which is less than 256 sscanf() buffer. Fix it by increasing size of nambuf buffer.
* Some changes didn't make it into 4.4.0.Guy Harris2013-06-221-5/+11
| | | | | | Fix the CHANGES list by moving some changes that got in after the 4.4.0 release was made into a list for 4.4.1, and add some additional fixes to that list.
* new test for DLT_IEEE802_11_RADIO w/ext. bitmapWim Torfs2013-05-062-0/+3
| | | | | | | | | I modified the mac80211 and ath9k kernel module such that extra information regarding rssi, etc are available, which is why I needed the extra bitmap. Capturing the packets is simply a matter of using tcpdump -i wlan0 -w dumpfile. Test-file-not-changed-due-to-doing-pulls-in-the-wrong-order-by: Guy Harris <guy@alum.mit.edu>
* fix bug #303 (DLT_IEEE802_11_RADIO ext. bitmaps)Denis Ovsienko2013-05-064-10/+43
| | | | | | | | | | | | | | | | | | | | | | | This bug was discovered and pinned down by Wim Torfs. The code in question handles DLT_IEEE802_11_RADIO datalink type, which consists of a variable-sized header, a variable number of fields and the actual 802.11 frame. The integers contained in the fields are aligned, properly extracting them is exactly the purpose of the existing "cpack" module. The issue with the current code is that it sets alignment base for cpack at the end of the variable-sized header, in other words, 64-bit integers would be properly extracted only so long as the header is 64-bit long, which only happens when the total number of bitmaps in it is odd (the minimum number of bitmaps is one). Once this condition isn't met, as is with two bitmaps, decoding becomes incorrect. The reporter's point that the alignment base must be the beginning of the variable-sized header is accurate. This commit adds a new cpack_advance() function to fast-forward the "c_next" pointer of a cpack_state context by an arbitrary number of octets. The ieee802_11_radio_print() function now uses it to skip the header and all its bitmaps, and the alignment base is now the header start.
* Fix error in my previous commit.Guy Harris2013-05-061-1/+1
|
* Rename a variable to attempt to fix an AIX compile error.Guy Harris2013-05-051-2/+2
| | | | | | | | | | | | On AIX 5.1, at least when compiling with xlc, the statement struct mp_remove_addr *rem_addr = (struct mp_remove_addr *) opt; gets a complaint "Syntax error: possible missing '{'?" "/usr/include/sys/xmem.h" #defines rem_addr; I've no idea whether we're indirectly including that, but maybe we are and maybe that's causing the problem.
* Not all platforms on which we compile define PRI[doux]16.Guy Harris2013-05-051-1/+1
| | | | | | | So don't use it; it's not necessary on any of the platforms on which we work. (The *only* ones that are needed are PRI[doux]64, because sometimes you need %ll[doux], sometimes you need %l[doux], and with MSVC you need whatever its run-time library requires.)
* .gitignore: add autom4te.cache/fxlb2013-05-051-0/+1
|
* unset executable bit on a few .h and .c filesDenis Ovsienko2013-05-056-0/+0
|
* fix year for 4.3.0 in CHANGESDenis Ovsienko2013-05-051-1/+1
|
* Fix off-by-one error in print-rx.cDenis Ovsienko2013-05-051-1/+1
| | | | | | | | Avoid dereferencing rx_cache[RX_CACHE_SIZE], which is one past the last valid element. (This fixes SF bug 3599633 / GH bug 287. I could not identify the name or email address of the original contributor. -- Denis)
* Avoid bitfields, unaligned accesses, packed structures, and PRI[ux]{16,32}.Guy Harris2013-05-052-147/+116
| | | | | | | | | | | | | | | | | | | | | | | Bitfields are not one of C's shining points. There is *NO* guarantee in what order bitfields are put within a structure - it's *NOT* necessarily the same as the byte order of the machine, and it's *ESPECIALLY* not guaranteed to be correlated with the value of the LBL_ALIGN definition (that definition has to do with whether unaligned accesses are supported by the hardware). In addition, even if they're declared as unsigned, that doesn't mean they're guaranteed to *be* unsigned. Don't use them. Unaligned accesses are not guaranteed to work, and fields in packets are not guaranteed to be naturally aligned. Use the EXTRACT_nBITS() macros. __attribute((packed))__ is a GCCism, and is not guaranteed to be supported by all compilers with which tcpdump can be compiled. Make integral fields > 1 byte arrays of u_int8_t's (which also lets us avoid the & in the EXTRACT_nBITS() macros). Some systems don't define the PRI[doux]16 and PRI[doux]32 macros, and others define them infelicitously (i.e., for PRI[doux]32, with an "l"; our 32-bit integer types are *not* longs, as we don't care about 16-bit-"int" platforms).
* Fix some compiler warnings from the previous checkin.Guy Harris2013-05-051-3/+3
|
* Fix MPTCP supportGregory Detal2013-05-055-316/+376
| | | | | | | | | Added: * option length check * option type and TCP flags check * more information printed Signed-off-by: Gregory Detal <gregory.detal@uclouvain.be>
* Put mptcp.h into the release tarball.Guy Harris2013-05-051-0/+1
|
* Point people to the the-tcpdump-group repositories, not the mcr repositories.Guy Harris2013-04-151-3/+3
| | | | | | | We've created a the-tcpdump-group organization on GitHub, and created repositories for libpcap and tcpdump, owned by them. Those are now the "official" GitHub locations for repositories from which to clone or against which to file issues/pull requests.
* Fix some compiler warnings.Guy Harris2013-04-141-3/+5
| | | | | Some of those warnings are real bugs - some routines whose callers expected them to return values weren't returning values.
* added RubenMichael Richardson2013-04-141-0/+1
|
* improve ZeroMQ support (ZMTP/1.0 inside PGM/EPGM)Denis Ovsienko2013-04-1410-0/+241
| | | | | | | | | | | This change adds new code to decode ZeroMQ datagrams, couples it with the PGM decoder and extends the -T option to make all this work. There are two new test cases based on existing captures of ZMTP/1.0 inside [E]PGM to decode the ZMTP/1.0 part of these. This functionality enables decoding of the traffic zeromq library produces for "pgm://" and "epgm://" protocol schemas.
* use existing PGM decoder for UDP-encapsulated PGMDenis Ovsienko2013-04-148-0/+46
| | | | | | | | | The original PGM uses its own IP protocol number. "EPGM" or "PGM/UDP" stands for UDP-encapsulated PGM, which has no assigned UDP port number and can be decoded only by means of -T option, which now accepts "pgm" protocol type for this purpose. There is also a sample capture of EPGM now (similar to the one of native PGM, but produced using the "epgm://" protocol schema) and a respective test case.
* add a test case for native PGMDenis Ovsienko2013-04-143-1/+32
| | | | | | | | This commit adds a capture of a few PGM (IP protocol 113) packets produced with version 2.2.0 of zeromq library built with PGM support (using the "pgm://" protocol schema). Each of the three ODATA packets in the capture contains a ZeroMQ datagram in the "Data" (application data) field. There is a new test case covering the PGM part of the capture.
* fix two issues with PGM length handlingDenis Ovsienko2013-04-141-5/+2
| | | | | | | | | | 1. "TSDU Length" comes in network byte order on wire, add missing macro. 2. The (unused) justification of the number of bytes on wire wasn't correct because one side of the comparison included header size and another didn't (note the byte order as well). Besides that, the value of TSDU Length was already output thus far. Don't justify the number of bytes on wire and change the final printf() to make a use of it.
* fix two printf format stringsDenis Ovsienko2013-04-142-2/+2
|
* Change C++ style comments to C style commentsfxlb2013-04-141-2/+2
|
* use macros for VAT and WB port numbersDenis Ovsienko2013-04-142-2/+4
|
* Multipath TCP (RFC 6824) supportGregory Detal2013-04-1411-2/+706
| | | | | | | | | This commit adds the support of Multipath TCP (MPTCP). MPTCP is a new extension to TCP standardized at the IETF. MPTCP allows to use several IP addresses at the same time by distributing data across several subflows (TCP connections) while still presenting the standard TCP socket API to the application. Its benefits are better resource utilization, better throughput and smoother reaction to failures.
* If we get SIGCHLD, restart whatever system call it interrupted.Alexandra Kossovsky2013-04-142-0/+3
| | | | | | | | When compressing output with -z, we do so by creating a child process to run gzip and pipe to it, and we catch SIGCHLD to clean up after the child process. We don't want the SIGCHLD to show up as an "Interrupted system call" error, so we specify that SIGCHLD should restart, rather than interrupting, system calls.
* There's another Cisco-private encapsulation of BPDUs.Guy Harris2013-04-132-0/+3
| | | | | At least according to the Wireshark STP dissector, SNAP frames with the Cisco OUI and a PID of 0x010c contain BPDUs, for "VLAN Bridge".
* Note that we fixed the IPv6 check for Solaris.Guy Harris2013-04-061-1/+3
|
* Check for extra networking libraries before checking for IPv6.Guy Harris2013-04-062-3335/+7541
| | | | | | | On some platforms, such as SunOS 5.x, building the "do we have IPv6 support?" test program requires the extra networking libraries, so we need to know what extra networking libraries are required before doing that test.
* Add tests for wrong agent-idRuben Kerkhof2013-03-292-0/+31
|
* fix function 'msnlb_print', unused parameter 'length'fxlb2013-03-293-3/+3
|