]> The Tcpdump Group git mirrors - tcpdump/log
tcpdump
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.

6 years agoFix dissection of RFC 4684 routing information.
Guy Harris [Tue, 4 Sep 2018 18:09:41 +0000 (11:09 -0700)] 
Fix dissection of RFC 4684 routing information.

RFC 4684, sadly, doesn't do a very good job of describing what a "route
target" is.  In practice, it appears to be a Route Target extended
community, as per RFC 4360 section 4 "Route Target Community".  Those do
*not* have the same format as an RFC 4364 Route Descriptor.

So just take the code to dissect an extended community, put it in a
subroutine, change it to directly print information rather than filling
in a static string buffer (C support for strings is spectacularly bad -
large variable-length objects are hard, let's go shopping!), and call
that routine when dissecting RFC 4684 routing information.

6 years agoFix spaces
Francois-Xavier Le Bail [Mon, 3 Sep 2018 12:03:25 +0000 (14:03 +0200)] 
Fix spaces

6 years agoTravis CI: Reduce git clone depth
Francois-Xavier Le Bail [Fri, 31 Aug 2018 14:03:51 +0000 (16:03 +0200)] 
Travis CI: Reduce git clone depth

6 years agoSquelch a warning on some platforms.
Guy Harris [Fri, 31 Aug 2018 06:42:53 +0000 (23:42 -0700)] 
Squelch a warning on some platforms.

Some platforms define the old V7 routine index() (renamed to strchr() in
System V; the latter name is what's used in ANSI C), and you get
"declaration of 'index' shadows a global declaration" warnings.

Call the variable if_index instead.

6 years agoRADIUS: constify a couple static arrays
Denis Ovsienko [Thu, 30 Aug 2018 14:25:59 +0000 (15:25 +0100)] 
RADIUS: constify a couple static arrays

[skip ci]

6 years agoFix spaces
Francois-Xavier Le Bail [Tue, 28 Aug 2018 15:15:19 +0000 (17:15 +0200)] 
Fix spaces

6 years agoCONTRIBUTING: Update about bounds checking
Francois-Xavier Le Bail [Thu, 23 Aug 2018 13:49:51 +0000 (15:49 +0200)] 
CONTRIBUTING: Update about bounds checking

6 years agoUse more the nd_print_trunc() call
Francois-Xavier Le Bail [Mon, 20 Aug 2018 14:20:27 +0000 (16:20 +0200)] 
Use more the nd_print_trunc() call

Update the output of some tests accordingly.

6 years agoEAP: Fixup the check for Code value.
Denis Ovsienko [Sat, 18 Aug 2018 18:00:36 +0000 (19:00 +0100)] 
EAP: Fixup the check for Code value.

Code value 0 is not assigned, and the code block guarded by the if() is
specific to Request (1) and Response (2) only. This change prevents the
printer from decoding some invalid EAP messages as if they were valid.

[skip ci]

6 years agoRADIUS: Deduplicate some printing code.
Denis Ovsienko [Sat, 18 Aug 2018 11:12:18 +0000 (12:12 +0100)] 
RADIUS: Deduplicate some printing code.

6 years agoEAP: simplify an if()
Denis Ovsienko [Fri, 17 Aug 2018 07:51:57 +0000 (08:51 +0100)] 
EAP: simplify an if()

[skip ci]

6 years agoTravis CI: Create .devel for both autotools and CMake
Francois-Xavier Le Bail [Tue, 14 Aug 2018 21:00:39 +0000 (23:00 +0200)] 
Travis CI: Create .devel for both autotools and CMake

That way, we do development builds for CMake as well, and get the
warnings turned up.

6 years agoTravis CI: Fold the 'cmake' output
Francois-Xavier Le Bail [Tue, 14 Aug 2018 20:57:34 +0000 (22:57 +0200)] 
Travis CI: Fold the 'cmake' output

This change allows to see better the possible warnings.

6 years agoTravis CI: Fix folding the 'configure' output
Francois-Xavier Le Bail [Tue, 14 Aug 2018 20:55:10 +0000 (22:55 +0200)] 
Travis CI: Fix folding the 'configure' output

6 years agoTravis CI: Simplify the script section
Francois-Xavier Le Bail [Tue, 14 Aug 2018 20:52:02 +0000 (22:52 +0200)] 
Travis CI: Simplify the script section

6 years agoNTP: Fix UTC/GMT timestamps printing according to RFC3339
Francois-Xavier Le Bail [Tue, 14 Aug 2018 12:12:56 +0000 (14:12 +0200)] 
NTP: Fix UTC/GMT timestamps printing according to RFC3339

Add the "Z" suffix for UTC.

According to the RFC3339:
      Z           A suffix which, when applied to a time, denotes a UTC
                  offset of 00:00; often spoken "Zulu" from the ICAO
                  phonetic alphabet representation of the letter "Z".

Update the output of some tests accordingly.

6 years agoTravis CI: Fix the openssl support in OSX build
fxlb [Sat, 11 Aug 2018 09:08:04 +0000 (11:08 +0200)] 
Travis CI: Fix the openssl support in OSX build

A directory name has changed.

Add OSX_SSL_DIR variable to track it.

6 years agoReport 32-bit timestamps with uppermost bit set as "Error converting time"
Francois-Xavier Le Bail [Thu, 9 Aug 2018 20:05:05 +0000 (22:05 +0200)] 
Report 32-bit timestamps with uppermost bit set as "Error converting time"

This is an update to packet header timestamps printing based on
Guy Harris's proposal.

Theses timestamps are outside the 1970-2038 range; This happens on some
fuzzed captures.

This will allow to have the same printing on Windows and UN*X.

Update needed before 2038.

6 years agoUpdate.
Guy Harris [Fri, 10 Aug 2018 20:56:15 +0000 (13:56 -0700)] 
Update.

-# is used to indicate which packets differ in how they're dissected,
not to ensure the reproducibility of the output.

We also set TZ to GMT0 to do all time-stamp printing in UTC.

6 years agoUpdate CONTRIBUTING and TESTLIST according to a recent change
Francois-Xavier Le Bail [Thu, 9 Aug 2018 18:34:56 +0000 (20:34 +0200)] 
Update CONTRIBUTING and TESTLIST according to a recent change

It's a follow-up to 018b2b8c96.

Thanks to Gisle Vanem to spot one of the inconsistencies.

Moreover:
Remove a useless '-#' option in TESTLIST.

6 years agoRefactor printing the time fractional part ({micro|nano}seconds)
Francois-Xavier Le Bail [Thu, 9 Aug 2018 11:25:23 +0000 (13:25 +0200)] 
Refactor printing the time fractional part ({micro|nano}seconds)

Add the ts_frac_print() function.

Avoid almost duplicate code.

6 years agoUse UTC/GMT time when building/checking tests files
Francois-Xavier Le Bail [Sat, 4 Aug 2018 06:46:17 +0000 (08:46 +0200)] 
Use UTC/GMT time when building/checking tests files

This will avoid some differences when checking in different time zones.

We now run the tests without the '-t' option. This will allow to get
problems/changes in time printing functions.

Update the output of the tests accordingly.

Moreover:
Add the '-#' option to better identify a packet when there is a difference
in output.

6 years agoExplicitly check to make sure the header length isn't too short.
Guy Harris [Wed, 8 Aug 2018 20:41:44 +0000 (13:41 -0700)] 
Explicitly check to make sure the header length isn't too short.

6 years agoAdd '-Wunreachable-code-return' warning option in devel mode for cmake
Francois-Xavier Le Bail [Tue, 7 Aug 2018 21:46:16 +0000 (23:46 +0200)] 
Add '-Wunreachable-code-return' warning option in devel mode for cmake

6 years agoSort the tested compiler warning options for cmake
Francois-Xavier Le Bail [Tue, 7 Aug 2018 21:36:44 +0000 (23:36 +0200)] 
Sort the tested compiler warning options for cmake