]> The Tcpdump Group git mirrors - tcpdump/log
tcpdump
6 years agoAmend the documentation about the use of the -C -G and -W switches. 722/head
Andrea Ieri [Sun, 16 Dec 2018 12:13:58 +0000 (13:13 +0100)] 
Amend the documentation about the use of the -C -G and -W switches.

When using all three switches (-C -G and -W), the behavior is
practically identical to only using -C and -G, as the -W flag will only
affect the filename suffix.

Fixes #695

6 years agoSquelch a narrowing warning.
Guy Harris [Tue, 11 Dec 2018 09:15:12 +0000 (01:15 -0800)] 
Squelch a narrowing warning.

Use a u_char variable for characters in the RST string; no need for it
to be an int.

6 years agoHave all Internet-checksum computing routines return a uint16_t.
Guy Harris [Tue, 11 Dec 2018 08:50:15 +0000 (00:50 -0800)] 
Have all Internet-checksum computing routines return a uint16_t.

Those checksums are 16-bit; change the return types of those routines
appropriately.

6 years agoSquelch some narrowing warnings.
Guy Harris [Tue, 11 Dec 2018 07:44:50 +0000 (23:44 -0800)] 
Squelch some narrowing warnings.

Mostly, we just throw in casts of values already known to be in the
range of values supported by the lvalue's type to that type.

Also, for the IPX SAP table, we make the SAP value a uint16_t, as SAP
values are 16-bit.

Make a hash table index unsigned, Just Because.

6 years agoUmm, wrong.
Guy Harris [Tue, 11 Dec 2018 07:26:25 +0000 (23:26 -0800)] 
Umm, wrong.

6 years agoAdd, and use, macros to do locale-independent case mapping.
Guy Harris [Tue, 11 Dec 2018 07:16:45 +0000 (23:16 -0800)] 
Add, and use, macros to do locale-independent case mapping.

This means we get the same behavior in Turkish locales (where, if we
aren't in the C locale, we might get lower-case "i" mapped to upper-case
"I with dot" and upper-case "I" mapped to lower-case "i without dot),
and may also suppress some shortening warnings from MSVC.

6 years agoRevert "Try to squelch a warning about non-constant format strings."
Guy Harris [Tue, 11 Dec 2018 06:01:39 +0000 (22:01 -0800)] 
Revert "Try to squelch a warning about non-constant format strings."

This reverts commit 76ed0bb39212d964946a22380288c34adc09030f.

It doesn't help.

We may just want to suppress the warning, as in "trust us, we know what
we're doing", although it'd be nice if the format string passed to those
functions could be checked to make sure it is one that takes exactly one
integer argument.

6 years agoTry to squelch a warning about non-constant format strings.
Guy Harris [Tue, 11 Dec 2018 05:53:58 +0000 (21:53 -0800)] 
Try to squelch a warning about non-constant format strings.

Declare the format-string argument to tok2strbuf(), tok2str(),
bittok2str(), and bittok2str_nosep() as such, to see whether that gets
MSVC not to complain - or if it just gets upset because there's no "..."
argument list for it.

6 years agoType and size cleanups.
Guy Harris [Tue, 11 Dec 2018 05:23:21 +0000 (21:23 -0800)] 
Type and size cleanups.

Make the count of 2-octet values to dump an unsigned value.

Make the variables into which we fetch those octets unsigned as well.

Cast the result of the "is the character printable ASCII?  If so, it's
the character, otherwise it's '.'" to char, to squelch narrowing
warnings.

6 years agoSquelch a warning.
Guy Harris [Tue, 11 Dec 2018 04:14:57 +0000 (20:14 -0800)] 
Squelch a warning.

We're returning the calculated checksum result modulo 65536, given that
Internet checksums are 16-bit; throw in a cast to let MSVC know that
this is intended.

6 years agoTry to squelch another annoying repeated warning.
Guy Harris [Tue, 11 Dec 2018 03:57:54 +0000 (19:57 -0800)] 
Try to squelch another annoying repeated warning.

6 years agoBuild with the Npcap SDK as well as the WinPcap SDK.
Guy Harris [Tue, 11 Dec 2018 03:22:39 +0000 (19:22 -0800)] 
Build with the Npcap SDK as well as the WinPcap SDK.

6 years agoChange tests/hoobr_bfd_print.pcap to test the BFD printer again.
Guy Harris [Wed, 21 Nov 2018 23:09:39 +0000 (15:09 -0800)] 
Change tests/hoobr_bfd_print.pcap to test the BFD printer again.

Clamp the on-the-wire length values of the packets at 262144, so that we
hand the packets to the BFD printer, rather than just bailing out before
we ever get there.

6 years agoRevert "Ethernet: Remove two useless tests"
Francois-Xavier Le Bail [Mon, 19 Nov 2018 15:02:40 +0000 (16:02 +0100)] 
Revert "Ethernet: Remove two useless tests"

This reverts commit b7fff7058282c332ba1d8d236c9864ab21b16adf (partially)

The sanity check in print.c/pretty_print_packet() function, packet length
(length) >= capture length (caplen), apply when the ether_print()
function is called by ether_if_print(), netanalyzer_if_print() or
netanalyzer_transparent_if_print().

But the ether_print() function is called in some other cases, thus not
sure length always >= caplen.

6 years agoHandle radiotap+802.11 for DLT_LINUX_SLL2 as well.
Guy Harris [Tue, 13 Nov 2018 06:56:24 +0000 (22:56 -0800)] 
Handle radiotap+802.11 for DLT_LINUX_SLL2 as well.

6 years agoFix printing of Linux cooked captures with monitor-mode packets.
Guy Harris [Tue, 13 Nov 2018 06:03:49 +0000 (22:03 -0800)] 
Fix printing of Linux cooked captures with monitor-mode packets.

Apparently, if you have an interface in monitor mode, capturing on the
"any" device can get packets that have a SLL hatype of 803, which is the
ARPHRD_ value for radiotap, and with the payload containing a radiotap
header, followed by an 802.11 header, followed by the 802.11 payload.
Handle that.

6 years agoICMPv6: add a comment for the previous commit
Denis Ovsienko [Mon, 12 Nov 2018 17:22:33 +0000 (17:22 +0000)] 
ICMPv6: add a comment for the previous commit

[skip ci]

6 years agoshow ICMPv6 echo request ID
Andreas Jaggi [Sun, 11 Nov 2018 18:36:30 +0000 (19:36 +0100)] 
show ICMPv6 echo request ID

6 years agoDCCP: Fix an undefined behavior at runtime
Francois-Xavier Le Bail [Mon, 12 Nov 2018 14:44:45 +0000 (15:44 +0100)] 
DCCP: Fix an undefined behavior at runtime

6 years agoDCCP: Fix some undefined behaviors at runtime
Francois-Xavier Le Bail [Sun, 11 Nov 2018 20:39:25 +0000 (21:39 +0100)] 
DCCP: Fix some undefined behaviors at runtime

The errors were like:
print-dccp.c:448:4: runtime error: unsigned integer overflow: 20 - 24
cannot be represented in type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior print-dccp.c:448:4

6 years agoSquelch annoying bogus Clang warnings.
Guy Harris [Fri, 9 Nov 2018 20:54:00 +0000 (12:54 -0800)] 
Squelch annoying bogus Clang warnings.

6 years agoRequire sys/capsicum.h to use Capsicum.
Guy Harris [Fri, 9 Nov 2018 20:00:59 +0000 (12:00 -0800)] 
Require sys/capsicum.h to use Capsicum.

My PC-BSD 9.1 VM, at least, has sys/capability.h but not sys/capsicum.h;
we now use sys/capsicum.h, so require it to be present (which it is in
FreeBSD 10 and later).

6 years agoFix typo.
Guy Harris [Fri, 9 Nov 2018 19:43:14 +0000 (11:43 -0800)] 
Fix typo.

6 years agoRequire sys/capsicum.h to use Capsicum.
Guy Harris [Fri, 9 Nov 2018 19:33:55 +0000 (11:33 -0800)] 
Require sys/capsicum.h to use Capsicum.

My PC-BSD 9.1 VM, at least, has sys/capability.h but not sys/capsicum.h;
we now use sys/capsicum.h, so require it to be present (which it is in
FreeBSD 10 and later).

6 years agoMerge pull request #715 from rbgarga/fix_capsicum_header
Guy Harris [Fri, 9 Nov 2018 19:20:00 +0000 (11:20 -0800)] 
Merge pull request #715 from rbgarga/fix_capsicum_header

Include correct capsicum header

6 years agoInclude correct capsicum header 715/head
Renato Botelho [Tue, 6 Nov 2018 10:55:22 +0000 (08:55 -0200)] 
Include correct capsicum header

Current included header `sys/capability.h` is deprecated. All
supported FreeBSD versions have now the proper header `sys/capsicum.h`

6 years agoUse more nd_print_invalid()
Francois-Xavier Le Bail [Fri, 2 Nov 2018 14:14:52 +0000 (15:14 +0100)] 
Use more nd_print_invalid()

6 years agoCompile with -Wsign-compare in devel mode if supported (cmake)
Francois-Xavier Le Bail [Tue, 30 Oct 2018 20:33:24 +0000 (21:33 +0100)] 
Compile with -Wsign-compare in devel mode if supported (cmake)

6 years agoCompile with '-Wsign-compare' in devel mode if supported
Francois-Xavier Le Bail [Mon, 29 Oct 2018 21:28:53 +0000 (22:28 +0100)] 
Compile with '-Wsign-compare' in devel mode if supported

6 years agoAdd two test files: an empty pcap and an empty pcapng
Francois-Xavier Le Bail [Mon, 29 Oct 2018 20:11:52 +0000 (21:11 +0100)] 
Add two test files: an empty pcap and an empty pcapng

6 years agoTravis CI: Add the "./tcpdump -h" command
Francois-Xavier Le Bail [Mon, 29 Oct 2018 15:54:42 +0000 (16:54 +0100)] 
Travis CI: Add the "./tcpdump -h" command

6 years agoAdd an usage message for the -m option
Francois-Xavier Le Bail [Mon, 29 Oct 2018 15:31:19 +0000 (16:31 +0100)] 
Add an usage message for the -m option

Moreover:
Fix a space.

6 years agoClean up whitespaces
Francois-Xavier Le Bail [Sat, 27 Oct 2018 15:36:31 +0000 (17:36 +0200)] 
Clean up whitespaces

6 years agoRemove a space (style)
Francois-Xavier Le Bail [Sat, 27 Oct 2018 14:49:23 +0000 (16:49 +0200)] 
Remove a space (style)

Moreover:
Fix indentation.

6 years agoFix nd_snprintf(buf, buflen, "string");
Guy Harris [Sun, 14 Oct 2018 05:51:54 +0000 (22:51 -0700)] 
Fix nd_snprintf(buf, buflen, "string");

If this is VS prior to 2015 or MinGW, we can't trust snprintf(); we have
to use _snprintf_s(), but that requires us to insert _TRUNCATE as an
argument after the buffer and buffer length and before the format string
and arguments, if any, to the format string.

That means we need to use a vararg macro; however, if we make the format
string a regular argument to the macro, that means that, if there are no
arguments *after* the format string, you end up with an argument list to
_snprintf_s() that ends with "fmt, ", and that's not valid C.

*If* we knew this was GCC or Clang, we could use a GNU C-specific hack,
wherein, if __VA_ARGS__ is preceded by ## and there's a comma before
that, the comma is removed if __VA_ARGS__ is empty, but this might be
Microsoft's C compiler in a version of Visual Studio prior to VS 2015,
which might not support that.

So we have to just have the macro take, as the ... arguments, the format
string and its arguments.

Addresses GitHub issue #713.

6 years agoClean up indentation.
Guy Harris [Wed, 10 Oct 2018 22:26:49 +0000 (15:26 -0700)] 
Clean up indentation.

6 years agoMerge pull request #710 from agnosticdev/return-checks
Guy Harris [Tue, 9 Oct 2018 08:02:45 +0000 (01:02 -0700)] 
Merge pull request #710 from agnosticdev/return-checks

return-checks: Added a return check for malloc and for strsep

6 years agoreturn-checks: Added a return check for malloc and for strsep 710/head
agnosticdev [Tue, 9 Oct 2018 02:18:52 +0000 (21:18 -0500)] 
return-checks: Added a return check for malloc and for strsep

6 years agoman page: Update the -ttt and -ttttt options sections
Francois-Xavier Le Bail [Fri, 5 Oct 2018 13:49:14 +0000 (15:49 +0200)] 
man page: Update the -ttt and -ttttt options sections

The delta is printed with microsecond or nanosecond resolution depending
on the --time-stamp-precision option (default is microsecond resolution).

6 years agoHarmonize a message
Francois-Xavier Le Bail [Fri, 5 Oct 2018 07:33:34 +0000 (09:33 +0200)] 
Harmonize a message

s/capture size/snapshot length/

It's a follow-up to 8a54b2483b.

6 years agoAdd the snapshot length to the "reading from file ..." message
Francois-Xavier Le Bail [Thu, 4 Oct 2018 19:59:44 +0000 (21:59 +0200)] 
Add the snapshot length to the "reading from file ..." message

6 years agoUse signed formats for signed values
Francois-Xavier Le Bail [Thu, 4 Oct 2018 14:24:38 +0000 (16:24 +0200)] 
Use signed formats for signed values

6 years agoMerge pull request #707 from herwinw/cleanup_win32_GNUMakefile
Guy Harris [Wed, 3 Oct 2018 20:11:28 +0000 (13:11 -0700)] 
Merge pull request #707 from herwinw/cleanup_win32_GNUMakefile

Fix tab/spaces in GNUmakefile of win32

6 years agoChange unknown attribute in test
Herwin Weststrate [Tue, 2 Oct 2018 14:26:22 +0000 (16:26 +0200)] 
Change unknown attribute in test

The value 127 is actually assigned to the Location-Information Attribute
(RFC 5580). Change it to a very high value.

6 years agoFix tab/spaces in GNUmakefile of win32 707/head
Herwin Weststrate [Wed, 3 Oct 2018 18:19:37 +0000 (20:19 +0200)] 
Fix tab/spaces in GNUmakefile of win32

6 years agoRemove unused TCP ports
Francois-Xavier Le Bail [Tue, 2 Oct 2018 16:44:42 +0000 (18:44 +0200)] 
Remove unused TCP ports

6 years agoMerge pull request #704 from nmap/win32-isatty
Guy Harris [Tue, 2 Oct 2018 16:48:02 +0000 (09:48 -0700)] 
Merge pull request #704 from nmap/win32-isatty

Ensure isatty is defined on Win32.

6 years agoRemove unused UDP ports
Francois-Xavier Le Bail [Tue, 2 Oct 2018 14:55:57 +0000 (16:55 +0200)] 
Remove unused UDP ports

6 years agoEnsure isatty is defined on Win32. 704/head
Daniel Miller [Tue, 2 Oct 2018 14:52:40 +0000 (09:52 -0500)] 
Ensure isatty is defined on Win32.

6 years agoSLIP: Remove printing the raw hex dump of the compressed header
Francois-Xavier Le Bail [Tue, 25 Sep 2018 20:21:09 +0000 (22:21 +0200)] 
SLIP: Remove printing the raw hex dump of the compressed header

ndo_nflag has not this function. We don't currently have an appropriate
flag for this use. Not sure printing the header in hex is currently useful.

Update the output of a test accordingly.

6 years agoAdd a nd_print_trunc() call
Francois-Xavier Le Bail [Mon, 24 Sep 2018 19:42:08 +0000 (21:42 +0200)] 
Add a nd_print_trunc() call

6 years agoICMPv6: Fix some truncation codes
Francois-Xavier Le Bail [Sun, 23 Sep 2018 16:51:23 +0000 (18:51 +0200)] 
ICMPv6: Fix some truncation codes

6 years agoIP6OPTS: Fix some truncation codes
Francois-Xavier Le Bail [Sun, 23 Sep 2018 16:06:00 +0000 (18:06 +0200)] 
IP6OPTS: Fix some truncation codes

Moreover:
Update the output of some tests accordingly.
Fix style.

6 years agoUpdate a test file.
Guy Harris [Mon, 24 Sep 2018 02:15:10 +0000 (19:15 -0700)] 
Update a test file.

The bug fix in ccd4a6b3b9165e575b8d425ea8ea96a8cb146df0 means we
correctly set the packet length to be the PDU length, so we can check
the checksum.

6 years agoClean up some narrowing warnings.
Guy Harris [Mon, 24 Sep 2018 01:09:56 +0000 (18:09 -0700)] 
Clean up some narrowing warnings.

Cast pointer differences, widen some variables, make some function
returns unsigned as they never return a negative number.

Fix a format while we're at it.

6 years agoFix the variable for the packet length.
Guy Harris [Mon, 24 Sep 2018 01:02:37 +0000 (18:02 -0700)] 
Fix the variable for the packet length.

The length passed in is a u_int, so we should assign it to a u_int, not
a u_short.

6 years agoSLIP: Add some bounds checks
Francois-Xavier Le Bail [Sat, 22 Sep 2018 14:20:43 +0000 (16:20 +0200)] 
SLIP: Add some bounds checks

This should fix GitHub issues #676 and #677.

6 years agoUpdate a comment
Francois-Xavier Le Bail [Sat, 22 Sep 2018 13:19:44 +0000 (15:19 +0200)] 
Update a comment

6 years agoIP: Simplify an expression
Francois-Xavier Le Bail [Sat, 22 Sep 2018 10:46:36 +0000 (12:46 +0200)] 
IP: Simplify an expression

6 years agoMerge pull request #701 from loganaden/master
Guy Harris [Sat, 22 Sep 2018 03:29:09 +0000 (20:29 -0700)] 
Merge pull request #701 from loganaden/master

Update my email address

6 years agoUpdate my email address 701/head
Loganaden Velvindron [Sat, 22 Sep 2018 03:23:04 +0000 (07:23 +0400)] 
Update my email address

6 years agoReorganize the dissection code a bit.
Guy Harris [Tue, 18 Sep 2018 07:07:24 +0000 (00:07 -0700)] 
Reorganize the dissection code a bit.

Get rid of the global nfserr variable and, instead, have it be local to
interp_reply().  That means one less global variable, which may be good
if any multi-threaded program tries to use libnetdissect in more than
one thread (there are still global variables that would have to be
removed), and gets rid of some cases where we didn't need to set it.

Don't bundle multiple operations inside an if clause.  This squelches
some warnings from MSVC, and makes the code a bit more uniform and a bit
easier to understand (and, in the process of doing that, found a bug
that was fixed in 596aca3d9384e739961df0b5c9ffd9d8161d6c9b).

6 years agoFix dissection of NFSv3 WRITE and LINK replies.
Guy Harris [Sun, 16 Sep 2018 15:33:38 +0000 (08:33 -0700)] 
Fix dissection of NFSv3 WRITE and LINK replies.

Don't report them all as truncated if -v isn't specified.

6 years agoThat wasn't correct.
Guy Harris [Sun, 16 Sep 2018 07:12:57 +0000 (00:12 -0700)] 
That wasn't correct.

6 years agoClean up the name resolution a bit.
Guy Harris [Sun, 16 Sep 2018 02:14:24 +0000 (19:14 -0700)] 
Clean up the name resolution a bit.

If we're not doing name-to-address resolution, don't bother with the
address-to-name table.

6 years agoDon't warn about declarations after statements.
Guy Harris [Sat, 15 Sep 2018 20:16:02 +0000 (13:16 -0700)] 
Don't warn about declarations after statements.

We now allow them, and require a compiler that supports them, so there's
no need to warn about them.

6 years agoDon't warn about declarations after statements.
Guy Harris [Sat, 15 Sep 2018 20:12:49 +0000 (13:12 -0700)] 
Don't warn about declarations after statements.

We now allow them, and require a compiler that supports them, so there's
no need to warn about them.

6 years agoAdd more nd_print_trunc() calls
Francois-Xavier Le Bail [Sat, 15 Sep 2018 15:38:43 +0000 (17:38 +0200)] 
Add more nd_print_trunc() calls

6 years agoFix data types.
Guy Harris [Sat, 15 Sep 2018 08:41:59 +0000 (01:41 -0700)] 
Fix data types.

If you're accumulating the lengths of strings, as returned by strlen(),
and passing the result to malloc(), it should be accumulated in a
size_t.

6 years agoMove getopt_long.h to missing.
Guy Harris [Sat, 15 Sep 2018 02:21:06 +0000 (19:21 -0700)] 
Move getopt_long.h to missing.

That's what we did for win_ether_ntohost.h.

6 years agoRevert "Clean up the code a bit."
Guy Harris [Sat, 15 Sep 2018 01:05:55 +0000 (18:05 -0700)] 
Revert "Clean up the code a bit."

This reverts commit a5eca2cbbfa991c0ae26d0b039bf303fa92734ac.

MSVC doesn't complain about it, so leave it alone.

6 years agoClean up the code a bit.
Guy Harris [Sat, 15 Sep 2018 00:48:45 +0000 (17:48 -0700)] 
Clean up the code a bit.

This eliminates a warning from MSVC, and makes the flow a little
clearer.

(Yes, it duplicates some code, but compilers have been pretty good at
merging common code sequences, so it might just turn it into the
equivalent of

if (optopt == (int)':')
goto label;
oli = strchr(ostr, optopt);
if (!oli) {
label:
/*
 * Unknown option character.
 */
if (!*place)
++optind;

...
}

although it does mean that the same C code exists in two places.)

6 years agoBGP: Fix an error string
Francois-Xavier Le Bail [Fri, 14 Sep 2018 19:37:53 +0000 (21:37 +0200)] 
BGP: Fix an error string

"[|" is the prefix for a truncated string. This is not the case here.

6 years agoRemove some useless tests
Francois-Xavier Le Bail [Fri, 14 Sep 2018 15:34:47 +0000 (17:34 +0200)] 
Remove some useless tests

Because packet length (length) >= capture length (caplen).

(see the sanity checks in print.c, pretty_print_packet() function)

6 years agoSee if a newer MSVC will produce fewer warnings.
Guy Harris [Fri, 14 Sep 2018 02:19:38 +0000 (19:19 -0700)] 
See if a newer MSVC will produce fewer warnings.

Some of the narrowing warnings are false positives; newer versions of
Clang do a better job than older ones of determining the range of values
of expressions, and don't warn if the range is such that it can be
safely narrowed, so maybe the same is true of MSVC.

6 years agoDo parallel builds, run as a developer.
Guy Harris [Fri, 14 Sep 2018 00:14:23 +0000 (17:14 -0700)] 
Do parallel builds, run as a developer.

Tell msbuild to build in parallel.  Use Windows syntax for command-line
flags.  Create the .devel file.

6 years agoTry to find the 64-bit libraries in a 64-bit build.
Guy Harris [Thu, 13 Sep 2018 23:26:39 +0000 (16:26 -0700)] 
Try to find the 64-bit libraries in a 64-bit build.

6 years agoDo both 32-bit and 64-bit builds.
Guy Harris [Thu, 13 Sep 2018 23:09:51 +0000 (16:09 -0700)] 
Do both 32-bit and 64-bit builds.

6 years agoAdd a nd_print_trunc() call
Francois-Xavier Le Bail [Thu, 13 Sep 2018 19:42:20 +0000 (21:42 +0200)] 
Add a nd_print_trunc() call

6 years agoAdd more nd_print_trunc() calls
Francois-Xavier Le Bail [Thu, 13 Sep 2018 19:16:44 +0000 (21:16 +0200)] 
Add more nd_print_trunc() calls

6 years agoAdd more nd_print_trunc() calls
Francois-Xavier Le Bail [Thu, 13 Sep 2018 19:05:16 +0000 (21:05 +0200)] 
Add more nd_print_trunc() calls

6 years agoSLL: Remove two useless tests
Francois-Xavier Le Bail [Thu, 13 Sep 2018 17:24:27 +0000 (19:24 +0200)] 
SLL: Remove two useless tests

Because packet length (length) >= capture length (caplen).

(see the sanity checks in print.c, pretty_print_packet() function)

6 years agoFix style
Francois-Xavier Le Bail [Thu, 13 Sep 2018 12:48:20 +0000 (14:48 +0200)] 
Fix style

6 years agoEthernet: Remove two useless tests
Francois-Xavier Le Bail [Thu, 13 Sep 2018 12:24:23 +0000 (14:24 +0200)] 
Ethernet: Remove two useless tests

Because packet length (len) >= capture length (caplen).

(see the sanity checks in print.c, pretty_print_packet() function)

6 years agoEthernet: Remove two useless tests
Francois-Xavier Le Bail [Wed, 12 Sep 2018 17:25:14 +0000 (19:25 +0200)] 
Ethernet: Remove two useless tests

Because packet length (length) >= capture length (caplen), when
caplen >= ETHER_HDRLEN, length >= caplen cannot be < ETHER_HDRLEN.

Same for the other test (length < 4).

(see the sanity checks in print.c, pretty_print_packet() function)

Moreover:
Clean up indentation.

6 years agoAdd the nd_print_invalid() function
Francois-Xavier Le Bail [Tue, 11 Sep 2018 10:27:55 +0000 (12:27 +0200)] 
Add the nd_print_invalid() function

It prints " (invalid)", used for malformed or corrupted packets.

Moreover:
Update CONTRIBUTING.

6 years agoMake the invalid snaplen message clearer
Francois-Xavier Le Bail [Mon, 10 Sep 2018 08:07:34 +0000 (10:07 +0200)] 
Make the invalid snaplen message clearer

6 years agoMore status exit codes for a program using libnetdissect
Francois-Xavier Le Bail [Sun, 9 Sep 2018 12:27:22 +0000 (14:27 +0200)] 
More status exit codes for a program using libnetdissect

It can now use status exit codes 0 to 10.

6 years agoUpdate a comment with the new macros names
Francois-Xavier Le Bail [Sun, 9 Sep 2018 11:41:36 +0000 (13:41 +0200)] 
Update a comment with the new macros names

6 years agoAdd the debug macro ND_DEBUG
Francois-Xavier Le Bail [Tue, 4 Sep 2018 19:50:33 +0000 (21:50 +0200)] 
Add the debug macro ND_DEBUG

6 years agoDon't assume ARM supports unaligned accesses.
Guy Harris [Thu, 6 Sep 2018 03:26:39 +0000 (20:26 -0700)] 
Don't assume ARM supports unaligned accesses.

Prior to ARMv6, it didn't support it.  ARMv6 supports it, if the "don't
act like ARMv5" bit isn't set in the system control register, but has
another bit in the system control register to cause unaligned accesses
to fault rather than succeed.  ARMv7 and later don't have "act like
ARMv5" mode, but still has the "fault on unaligned access" bit.

At least some OSes might set the "fault on unaligned access" bit; if
your OS *doesn't* set it, feel free to modify the #if to check for your
OS and for ARM.

6 years agoClean up white space.
Guy Harris [Wed, 5 Sep 2018 19:51:24 +0000 (12:51 -0700)] 
Clean up white space.

6 years agoFix test output files to match Juniper dissector changes.
Guy Harris [Wed, 5 Sep 2018 19:40:35 +0000 (12:40 -0700)] 
Fix test output files to match Juniper dissector changes.

6 years agoClean up indentation.
Guy Harris [Wed, 5 Sep 2018 19:05:35 +0000 (12:05 -0700)] 
Clean up indentation.

6 years agoRemove trailing "_if" from protocol names.
Guy Harris [Wed, 5 Sep 2018 19:04:03 +0000 (12:04 -0700)] 
Remove trailing "_if" from protocol names.

"_if", in function names, is just a convention used for the top-level
routine for a given DLT_ value; it's not part of the protocol name for
the link-layer type.

6 years agoadd test for nfs write verf cookie
Viral Mehta [Fri, 24 Aug 2018 09:14:51 +0000 (05:14 -0400)] 
add test for nfs write verf cookie

test results:
[vmehta@centos72_base tcpdump]# make check | grep nfs
    unaligned-nfs-1                    : passed
    nfs-attr-oobr                      : passed
    hoobr_nfs_printfh                  : passed
    hoobr_nfs_xid_map_enter            : passed
    nfs-seg-fault-1                    : passed
    nfs-write-verf-cookie              : passed <- new test

6 years agoprint verifier cookie for write and commit operation
Viral Mehta [Thu, 23 Aug 2018 04:09:14 +0000 (00:09 -0400)] 
print verifier cookie for write and commit operation

6 years agoFix the fix.
Guy Harris [Tue, 4 Sep 2018 21:19:20 +0000 (14:19 -0700)] 
Fix the fix.

6 years agoFix the no-SSL-library version of that test.
Guy Harris [Tue, 4 Sep 2018 21:10:24 +0000 (14:10 -0700)] 
Fix the no-SSL-library version of that test.

6 years agoFix tests for BGP changes.
Guy Harris [Tue, 4 Sep 2018 18:34:41 +0000 (11:34 -0700)] 
Fix tests for BGP changes.