Commit Graph

4000 Commits

Author SHA1 Message Date
Guy Harris
d6aacc676d Squelch a Coverity warning.
See Coverity CID 1324572 for tcpdump - the unsigned octets from the IPv6
address were getting extended to ints as a result of getting shifted
left by an int, so make the loop counter unsigned.
2015-11-18 13:07:34 -08:00
Guy Harris
938056a4b6 Remove debugging printouts. 2015-11-18 12:46:25 -08:00
Francois-Xavier Le Bail
255a101c7e ISOCLNS: Filter out non-printable characters
Use fn_printzp().

Moreover:
Delete extra blank lines.
2015-11-11 15:48:20 +01:00
Francois-Xavier Le Bail
dee95f4fb4 VTP: Filter out non-printable characters
Use fn_printzp().

Moreover:
Improve some comments.
Use 'type' instead of '*(tptr+1)' when possible.
2015-11-10 13:28:17 +01:00
Francois-Xavier Le Bail
f06ad54406 RADIUS: Filter out non-printable characters
Update a test according to this change.
2015-11-09 20:09:04 +01:00
Francois-Xavier Le Bail
4df36ab95d CDP: Filter out non-printable characters
Add a fn_print_char() to do filtering.
2015-11-09 16:29:32 +01:00
Francois-Xavier Le Bail
ef87bed366 RSVP: Add some bounds checks
Moreover:
Add and use tstr[] string.
2015-11-06 18:55:56 +01:00
Francois-Xavier Le Bail
be8e9c9dea ISOCLNS: Fix a segmentation fault
Moreover:
Avoid two consecutive truncation messages.
2015-11-04 23:10:49 +01:00
Guy Harris
e64b287afd Keep our own Ethertype-to-name map.
Don't use a hack to get the table from libpcap; have our own table.
That cleans up the hack, and lets us add stuff to our table without
having to worry about libpcap.
2015-11-03 19:06:41 -08:00
Guy Harris
a7a4480813 Merge pull request #486 from loos-br/master
Fix capsicum support to work with zerocopy buffers in bpf.
2015-11-01 15:39:46 -08:00
Guy Harris
23d1a76b3e Missing comma in list of initializers. 2015-11-01 13:27:32 -08:00
Guy Harris
6e8dc38172 Beginnings of 11ac radiotap support. 2015-11-01 11:41:26 -08:00
Guy Harris
795239658b PRIu64 includes the "u". 2015-10-31 10:38:09 -07:00
Guy Harris
3c2d259206 We need PRIu64 to print a uint64_t. 2015-10-31 10:26:06 -07:00
Denis Ovsienko
f4c23604a0 ZeroMQ: avoid code duplication 2015-10-31 16:52:22 +00:00
Francois-Xavier Le Bail
f2200abafd Coverity: Build script: Update the upload URL for the framework change
This fix the build submission error.

Moreover:
More sync with the updated default build script.
2015-10-30 19:10:30 +01:00
Francois-Xavier Le Bail
09f56fe763 Fix some comments
Moreover:
Fix mixed spaces/tabs.
2015-10-27 11:58:21 +01:00
Francois-Xavier Le Bail
8db57a4b90 ISOCLNS: Fix two segmentation faults
Moreover:
Add/fix a lot of bounds and length checks.
Add and use tstr[] string.
Fix some typos.
Update the output of a test according to these changes.
2015-10-17 22:54:47 +02:00
Gisle Vanem
2862abfda0 Fix a test name 2015-10-15 16:55:22 +02:00
Luiz Otavio O Souza
0a5ca18bab Fix capsicum support to work with zerocopy buffers in bpf.
Zerocopcy buffers in bpf was broken until recently in FreeBSD and now that
it is fixed, tcpdump is failing with insuficient capabilities when trying to
use the BIOCROTZBUF ioctl.

This commit adds BIOCROTZBUF to the list of allowed ioctls.
2015-10-14 10:05:24 -05:00
Francois-Xavier Le Bail
8e23441356 Add missing output files for LSP-Ping capture files 2015-10-13 16:31:45 +02:00
Francois-Xavier Le Bail
a1dadfb1bc Fix the error handling in 'ndo_printf' function
Moreover:
Replace strerror() calls with pcap_strerror() calls, in case some platform
lacks strerror().
2015-10-12 22:30:31 +02:00
Francois-Xavier Le Bail
5ef7141caa Add test files for pcap-ng invalid versions 2015-10-10 18:54:46 +02:00
Francois-Xavier Le Bail
9cb72d9469 Add test files for pcap invalid versions 2015-10-10 18:22:22 +02:00
Francois-Xavier Le Bail
e32088572e Fix the pcap version in tests/cve2015-0261-crash.pcap
It will be always usable with the upcoming libpcap versions sanity checks.
(old version: 12336.12336, new version: 2.4)
2015-10-10 14:36:08 +02:00
Francois-Xavier Le Bail
7194047efd Get rid of "TCPDUMP" in some libnetdissect codes 2015-10-08 16:36:23 +02:00
Francois-Xavier Le Bail
38e91e5c3f Fix a comment
Moreover:
s/tcpdump/netdissect/
2015-10-08 16:26:36 +02:00
Guy Harris
bfe9582ec6 Use the nd_uintN_t types more.
Define them in netdissect.h.

Use them in ip.h, and *don't* mark the structures as UNALIGNED; that
should no longer be necessary.

Add a new nd_ipv4 type to use as an IPv4 address; it represents the 4
bytes of IPv4 address as an array of unsigned chars, so that its natural
alignment is only on a byte boundary.

Those changes found some places where we weren't using
UNALIGNED_MEMCPY() to extract IPv4 addresses from packets; use it.
2015-10-07 00:14:20 -07:00
Guy Harris
6f1c171a6a Squelch some "constness casted away" warnings. 2015-10-06 22:48:09 -07:00
Guy Harris
1376682ba5 Introduce data types to use for integral values in packet structures.
They are defined as arrays of bytes, so

	1) no padding is inserted before them to put them on natural
	   boundaries, so they can be used if the values *aren't* so
	   aligned;

	2) you have to use EXTRACT_ macros with them - which you should
	   be doing *anyway*, to avoid explicitly or implicitly making
	   assumptions about byte order or alignment safety on the
	   platform for which your code is being built (it'd better work
	   when built for little-endian x86 or for big-endian *and*
	   strict-alignment-requiring SPARC).

Use them in the LISP (no, not the programming language!) dissector;
UNALIGNED means "this structure is not guaranteed to be aligned as a
whole, so don't generate code that assumes it is", not "this structure's
individual members shouldn't have padding to put them on natural
boundaries", so it's not sufficient to do that.  (Using these types
*might* suffice to ensure that code that assumes alignment not be
generated, but never underestimate SPARC compilers' eagerness to use
single load and store instructions to fetch big-endian 16-bit, 32-bit,
and 64-bit values from packets that really aren't guaranteed to be
aligned.)
2015-10-06 09:41:01 -07:00
Francois-Xavier Le Bail
d7d269e8c6 RSVP: Fix an infinite loop 2015-10-06 16:24:40 +02:00
Francois-Xavier Le Bail
a14ec7492f Fix a trailing tab 2015-10-05 14:41:18 +02:00
Francois-Xavier Le Bail
bbf859b415 LISP: Fix a Clang warning
The warning was:
./print-lisp.c:401:11: warning: variable 'xtr_present' is used uninitialized
      whenever 'if' condition is false [-Wsometimes-uninitialized]
        else if (type == LISP_MAP_NOTIFY)
                 ^~~~~~~~~~~~~~~~~~~~~~~

./print-lisp.c:404:9: note: uninitialized use occurs here
        return xtr_present;
               ^~~~~~~~~~~

Moreover:
Remove unused 'interface.h' include.
2015-10-05 11:29:35 +02:00
Francois-Xavier Le Bail
eea2b6d5dd LISP: We always support IPv6 addresses now
INET6 is no more used.
2015-10-05 09:25:46 +02:00
ritsz
823644a72d Initial commit for support of Type 3 and Type 4 LISP packets.
Fixing Travis CI build for LISP commit

Adding testcases for lisp notify and register

Fixing build warnings

Added ND_TCHECK for relevant headers

Fixing ND_TCHECK2 issues

Adding support for multiple LOC records for same EID entry

Fixing review issues, adding detailed tests

Adding support for verbose outputs

Adding RFC information for UDP PORT defination

Removing Spaces in type names

Print EID record related flags in verbose mode

Using tok2str

Fixing -Wpedantic issues

Negative testcases, Packet structure comments, verbose mode flag printing

Printing Map Version

Print auth_data, decouple type and xtr_present extraction, handle malformed packets correctly

Tests for latest code changes

Printing useful info incase not built with IPv6 support
2015-10-04 12:47:13 +02:00
Francois-Xavier Le Bail
6be3de14f5 CONTRIBUTING: Index the remarks with letters for later references 2015-10-02 23:47:17 +02:00
Guy Harris
494b45734c We need -Werror when testing whether -f or -m flags work.
Thank you, clang, for treating unknown -f flags as warnings, only
failing with them if run with -Werror, and spewing out warning messages
whenever they're used.
2015-09-29 01:15:53 -07:00
Guy Harris
c632b5f3d1 Fix check for MCS field being present.
Fix test file while we're at it.
2015-09-28 20:09:53 -07:00
Guy Harris
5da6c2b8c9 Update tests for 11n fix. 2015-09-28 18:50:40 -07:00
Guy Harris
1daa186986 If we have the MCS field, it's 11n.
Pass print_chaninfo() the presence flags, and, if IEEE80211_RADIOTAP_MCS
is set, report it as 11n, rather than looking at the channel flags to
figure out whether it's FHSS or 11b/11a/11g.

Fix typo while we're at it ("long GI", not "lon GI").
2015-09-28 18:19:31 -07:00
Guy Harris
9678a1c75d More whitespace cleanup. 2015-09-28 16:03:24 -07:00
Guy Harris
d8d54817ce Clean up white space. 2015-09-28 16:02:42 -07:00
Guy Harris
1d59505683 Shuffle some stuff around a bit.
There were two places with radiotap stuff; move them together.
2015-09-28 16:01:16 -07:00
Guy Harris
548ed98f3b Don't check for libcrypto if we don't have its headers.
Thanks, Apple.
2015-09-28 00:41:01 -07:00
Guy Harris
f9e2b904df Clean up some variable names.
"devlist" is a pointer to the first in a list of devices; "dev" is a
pointer into that list.
2015-09-24 15:47:47 -07:00
Guy Harris
baa2529c19 Merge pull request #483 from sinic/master
Free all and entire lists pcap_findalldevs() returns
2015-09-24 15:06:36 -07:00
Simon Nicolussi
8d841db1ee Free the list of devices after printing it (-D)
It doesn't make much of a difference because of the exit(0) right
afterwards, but prevents Valgrind from complaining about a leak.
2015-09-24 22:59:38 +02:00
Simon Nicolussi
79fab92e67 Free the entire list of devices, not just its tail 2015-09-24 21:42:47 +02:00
Guy Harris
0501579a69 Free up lists we get from pcap_findalldevs().
That means we need to make a copy of a name we get from the list.
2015-09-21 15:35:42 -07:00
Guy Harris
224b073517 Merge pull request #482 from sinic/master
Use pcap_findalldevs() to find the default interface, if available.

This defaults to the correct interface on Windows.

It also means that, if you're unlucky enough to have only a loopback
interface, it'll find that interface.  (This is a feature, not a bug.)
2015-09-21 15:25:58 -07:00