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

6 years agoRemove the no more used gmt2local() function
Francois-Xavier Le Bail [Tue, 7 Aug 2018 18:27:29 +0000 (20:27 +0200)] 
Remove the no more used gmt2local() function

6 years agoFix local time printing
Francois-Xavier Le Bail [Tue, 7 Aug 2018 15:11:43 +0000 (17:11 +0200)] 
Fix local time printing

Using seconds offset from GMT to local time to compute local time give
errors when printing times outside the same daylight saving time period.

Use the localtime() function for default and -tttt cases.
Use the gmtime() function for -ttt and -ttttt cases.

Rename ts_hmsfrac_print() to ts_date_hmsfrac_print().
Remove some variables now useless.
Update some comments.

6 years agoRADIUS: Decode more MIP6-Feature-Vector bits.
Denis Ovsienko [Mon, 6 Aug 2018 14:56:57 +0000 (14:56 +0000)] 
RADIUS: Decode more MIP6-Feature-Vector bits.

Add more allocations from and a link to the Mobility Capability registry.

6 years agoFix spaces
Francois-Xavier Le Bail [Mon, 6 Aug 2018 14:12:32 +0000 (16:12 +0200)] 
Fix spaces

6 years agoAdd a test for the RX/AFS protocol.
Denis Ovsienko [Fri, 3 Aug 2018 21:07:51 +0000 (22:07 +0100)] 
Add a test for the RX/AFS protocol.

The .pcap file is from https://wiki.wireshark.org/SampleCaptures, as
suggested on the openafs-devel mailing list.

6 years agoMerge pull request #636 from herwinw/radius
Denis Ovsienko [Fri, 3 Aug 2018 13:29:41 +0000 (14:29 +0100)] 
Merge pull request #636 from herwinw/radius

6 years agoImprove printout of MIP6-Feature-Vector 636/head
Denis Ovsienko [Thu, 2 Aug 2018 14:19:45 +0000 (16:19 +0200)] 
Improve printout of MIP6-Feature-Vector

6 years agoAdded RADIUS attributes from RFC 5447
Herwin Weststrate [Tue, 3 Oct 2017 18:10:23 +0000 (20:10 +0200)] 
Added RADIUS attributes from RFC 5447

* MIP6-Feature-Vector (124) (with extra attributes from RFC 6572)
* MIP6-Home-Link-Prefix (125)

6 years agoBGP: Add two comments
Francois-Xavier Le Bail [Thu, 2 Aug 2018 20:01:22 +0000 (22:01 +0200)] 
BGP: Add two comments

6 years agoFix some spelling in comments.
Denis Ovsienko [Wed, 1 Aug 2018 13:06:33 +0000 (14:06 +0100)] 
Fix some spelling in comments.

[skip ci]

6 years agoRefresh the CI status badges in README.md.
Denis Ovsienko [Wed, 1 Aug 2018 10:31:24 +0000 (10:31 +0000)] 
Refresh the CI status badges in README.md.

[skip ci]

6 years agoClean up indentation.
Guy Harris [Tue, 31 Jul 2018 16:58:38 +0000 (09:58 -0700)] 
Clean up indentation.

6 years agoAdd check for pcap timestamp warnings. (GH #693)
Greg Steinbrecher [Tue, 31 Jul 2018 12:54:04 +0000 (05:54 -0700)] 
Add check for pcap timestamp warnings. (GH #693)

Previously would silently accept any of "host", "adapter", or
"adapter_unsynced" regardless of whether the interface supported
the option.

6 years agoCLNP: Squelch a cppcheck warning (GH #629)
Denis Ovsienko [Mon, 30 Jul 2018 13:08:03 +0000 (14:08 +0100)] 
CLNP: Squelch a cppcheck warning (GH #629)

See also commit f944e1e39.

[print-isoclns.c:906] -> [print-isoclns.c:910]: (warning) Opposite inner
'if' condition leads to a dead code block.

[skip ci]

6 years agoDon't print timestamps to a buffer and then print the buffer.
Guy Harris [Mon, 30 Jul 2018 02:16:42 +0000 (19:16 -0700)] 
Don't print timestamps to a buffer and then print the buffer.

Just directly print them.  This means:

1) we don't have to worry about making a big enough buffer;

2) we don't get annoying warnings about string truncation
   due to invalid timestamp values;

3) we use a constant string as a format, so that the compiler
   can more easily do format string vs. format argument checks.

6 years agoIf none of those are defined, there's nothing to dissect.
Guy Harris [Mon, 30 Jul 2018 01:16:41 +0000 (18:16 -0700)] 
If none of those are defined, there's nothing to dissect.

Wrap everyting in the big #if.

6 years agoWrap unused definitions and declarations in #ifdef/#if.
Guy Harris [Mon, 30 Jul 2018 01:06:33 +0000 (18:06 -0700)] 
Wrap unused definitions and declarations in #ifdef/#if.

Some stuff is used only by certain dissectors; define/declare it only if
the dissectors that use it are being compiled.

6 years agoInclude pcap-missing.h, to get the declaration of pcap_datalink_val_to_name().
Guy Harris [Sun, 29 Jul 2018 22:08:16 +0000 (15:08 -0700)] 
Include pcap-missing.h, to get the declaration of pcap_datalink_val_to_name().

If we're building with an old version of libpcap that doesn't include
pcap_datalink_val_to_name(), we incorporate our own version, but we need
to have it declared before we use it.

6 years agoSurround some declarations/definitions with #ifdefs.
Guy Harris [Sun, 29 Jul 2018 21:59:40 +0000 (14:59 -0700)] 
Surround some declarations/definitions with #ifdefs.

Some variables are used only if certain pcap APIs are available; don't
define them if the APIs aren't available.

We don't define show_tstamp_types_and_exit() unless we have
pcap_set_tstamp_type(); don't declare it if we don't define it.

6 years agoUpdate the list of files in INSTALL.txt.
Denis Ovsienko [Sat, 28 Jul 2018 21:03:57 +0000 (22:03 +0100)] 
Update the list of files in INSTALL.txt.

[skip ci]

6 years agoRx: Fix remaining fall-through warnings (GH #618).
Denis Ovsienko [Sat, 28 Jul 2018 20:03:22 +0000 (21:03 +0100)] 
Rx: Fix remaining fall-through warnings (GH #618).

Benjamin Kaduk explains in the issue comments:

The first two ("bulk stat" and "callback"; lines 1023 and 1282) should
not fall through, but the other two ("list entry" in various forms,
lines 1741 and 1790) should fall through. The answer lies in the RPC-L
files at [1], [2] and [3] (also line 396), looking at the appropriate IN
or OUT arguments.

1: http://git.openafs.org/?p=openafs.git;a=blob;f=src/fsint/afsint.xg;h=9fe4980c6cffcae457789e363393825e29dcb7b1;hb=HEAD#l594
2: http://git.openafs.org/?p=openafs.git;a=blob;f=src/fsint/afscbint.xg;h=19760bc512c647595662c30e190303b3a20be983;hb=HEAD#l22
3: http://git.openafs.org/?p=openafs.git;a=blob;f=src/vlserver/vldbint.xg;h=ff34d12d45454de328439cab3ed896fd564f0c59;hb=HEAD#l341

6 years agoRemove a useless warning about the SMB decoder.
Denis Ovsienko [Sat, 28 Jul 2018 19:33:34 +0000 (20:33 +0100)] 
Remove a useless warning about the SMB decoder.

In the last couple years it had been proved that any decoder can
potentially have buffer overflows, hence let's not emphasize one of them
more than the others.

6 years agoFix a typo in a comment.
Denis Ovsienko [Sat, 28 Jul 2018 19:31:27 +0000 (20:31 +0100)] 
Fix a typo in a comment.

6 years agoTry the pcap_dump_ftell() check after pcap-config.
Denis Ovsienko [Sat, 28 Jul 2018 19:07:13 +0000 (20:07 +0100)] 
Try the pcap_dump_ftell() check after pcap-config.

Apparently, the test for pcap_dump_ftell() cannot succeed if the test
program isn't linked with libpcap, this depending on the output of
pcap-config. That's why all pcap_* function checks come after the
pcap-config check.

This explains why in my working copy a ./configure build of the previous
commit tree with the master branch of libpcap found that the function
was "missing" and tried to substitute it with the local implementation
and eventually failed trying to link with libpcap that actually had the
function.

However, this does not explain why all 32 Travis CI builds of the same
tree passed, including the builds that used autotools.

6 years agoStick with one version of pcap_dump_ftell.c.
Denis Ovsienko [Sat, 28 Jul 2018 12:36:17 +0000 (13:36 +0100)] 
Stick with one version of pcap_dump_ftell.c.

It looks like CMake after commit 3e9e2b6 started to use the newly added
missing/pcap_dump_ftell.c to make pcap_dump_ftell() available in tcpdump
if libpcap does not have it. However, autotools continued to use the
previously existing ./pcap_dump_ftell.c for the same purpose. Remove the
previously existing file and amend autotools files to cover
pcap_dump_ftell() the same way as the other functions in the missing/
directory files.

Amend missing/pcap_dump_ftell.c not to use pcap_dump_file(), as it may be
unavailable.

This has been tested to work with libpcap 0.6.1.

6 years agoMerge pull request #692 from wrigjl/master
Guy Harris [Thu, 26 Jul 2018 16:56:50 +0000 (09:56 -0700)] 
Merge pull request #692 from wrigjl/master

remove clauses 3/4 from license

6 years agoremove clauses 3/4 from license 692/head
Jason L. Wright [Thu, 26 Jul 2018 14:51:21 +0000 (08:51 -0600)] 
remove clauses 3/4 from license

6 years agoCLNP: squelch a fall-through warning (GH #618)
Denis Ovsienko [Thu, 26 Jul 2018 12:16:11 +0000 (13:16 +0100)] 
CLNP: squelch a fall-through warning (GH #618)

This change addresses one of the warnings listed in the bug report.

./print-isoclns.c: In function ‘clnp_print’:
./print-isoclns.c:1054:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
             if (EXTRACT_U_1(pptr) == NLPID_CLNP) {
                ^
./print-isoclns.c:1061:9: note: here
         case  CLNP_PDU_DT:
         ^~~~

[skip ci]

6 years agoSquelch a -Wdeclaration-after-statement warning.
Denis Ovsienko [Sat, 21 Jul 2018 21:50:25 +0000 (22:50 +0100)] 
Squelch a -Wdeclaration-after-statement warning.

./print-sll.c: In function ‘sll2_if_print’:
./print-sll.c:419:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  uint32_t index = EXTRACT_BE_U_4(sllp->sll2_if_index);
  ^~~~~~~~

[skip ci]

6 years agoDo not decrease font size for CLI output examples.
Denis Ovsienko [Thu, 19 Jul 2018 11:18:57 +0000 (11:18 +0000)] 
Do not decrease font size for CLI output examples.

Three CLI output examples in the tcpdump man page used to request a
smaller font size since the beginning of the version control history.
That had no effect on the plain text format, and made the examples
difficult to read in the HTML format, so get rid of it.

[skip ci]

6 years agoDisplay interface and index and name on DLT_LINUX_SLL2
Petr Vorel [Thu, 12 Jul 2018 20:01:43 +0000 (22:01 +0200)] 
Display interface and index and name on DLT_LINUX_SLL2

Index is displayed always, name only if available.

Warn about possible wrong interfaces when in reading mode
(pcap file can be displayed on a different host then where
was captured) [1].

See: GH the-tcpdump-group/libpcap#127

[1] https://lists.sandelman.ca/pipermail/tcpdump-workers/2018-July/001019.html

Signed-off-by: Petr Vorel <[email protected]>
Suggested-by: Guy Harris <[email protected]>
Reviewed-by: Denis Ovsienko <[email protected]>
Reviewed-by: Guy Harris <[email protected]>
6 years agoFixup some references in the man page.
Denis Ovsienko [Wed, 18 Jul 2018 12:03:55 +0000 (12:03 +0000)] 
Fixup some references in the man page.

This way the references are proper hyperlinks in the HTML version.

[skip ci]

6 years agoCompile with '-Wunreachable-code-return' in devel mode if supported
Francois-Xavier Le Bail [Tue, 17 Jul 2018 20:22:49 +0000 (22:22 +0200)] 
Compile with '-Wunreachable-code-return' in devel mode if supported

6 years agoESP: Fix some unreachable code warnings
Francois-Xavier Le Bail [Tue, 17 Jul 2018 20:10:57 +0000 (22:10 +0200)] 
ESP: Fix some unreachable code warnings

Found with -Wunreachable-code-return clang compiler option.

The errors were:

./print-esp.c:317:10: warning: 'return' will never be executed
      [-Wunreachable-code-return]
                return 0;
                       ^
./print-esp.c:552:4: warning: 'return' will never be executed
      [-Wunreachable-code-return]
                        return;
                        ^~~~~~

6 years agoExit if capng_change_id() fails to change the uid
Francois-Xavier Le Bail [Sat, 14 Jul 2018 16:18:12 +0000 (18:18 +0200)] 
Exit if capng_change_id() fails to change the uid

From Linux manual page of capng_change_id():
    Note:  the only  safe action to do upon failure of this function is to
    probably exit. This is because you are likely in a situation with par-
    tial permissions and not what you intended.

6 years agoUse more the error() function
Francois-Xavier Le Bail [Sat, 14 Jul 2018 15:02:34 +0000 (17:02 +0200)] 
Use more the error() function

6 years agoRename two pcapng test files to .pcapng
Francois-Xavier Le Bail [Sat, 14 Jul 2018 13:21:31 +0000 (15:21 +0200)] 
Rename two pcapng test files to .pcapng

Moreover:
Rename 'pcap-ng' to 'pcapng'.

6 years agoIn the DLT_LINUX_SLL2 header, the packet type is one octet, not two.
Guy Harris [Fri, 13 Jul 2018 19:10:05 +0000 (12:10 -0700)] 
In the DLT_LINUX_SLL2 header, the packet type is one octet, not two.

6 years agoDLT_LINUX_SLL2 support.
Guy Harris [Thu, 12 Jul 2018 18:49:28 +0000 (11:49 -0700)] 
DLT_LINUX_SLL2 support.

6 years agoHandle the output of pcap-config --cflags being empty.
Guy Harris [Thu, 12 Jul 2018 17:29:49 +0000 (10:29 -0700)] 
Handle the output of pcap-config --cflags being empty.

Quote it in the string(REGEX REPLACE) call.

6 years agoSquelch an unused parameter warning.
Denis Ovsienko [Thu, 12 Jul 2018 14:02:56 +0000 (15:02 +0100)] 
Squelch an unused parameter warning.

When libpcap was compiled without the remote capture support, compiling
tcpdump would emit the following warning:

./tcpdump.c: In function ‘find_interface_by_number’:
./tcpdump.c:1122:38: warning: unused parameter ‘url’ [-Wunused-parameter]
 find_interface_by_number(const char *url, long devnum)
                                      ^~~

Add a conditional "unused" attribute to manage that.

[skip ci]

6 years agoFixup some hyphenation in the man page.
Denis Ovsienko [Wed, 11 Jul 2018 09:28:58 +0000 (10:28 +0100)] 
Fixup some hyphenation in the man page.

[skip ci]

6 years agoFix an undefined behavior at runtime in parsenfsfh.c
Francois-Xavier Le Bail [Tue, 10 Jul 2018 19:43:31 +0000 (21:43 +0200)] 
Fix an undefined behavior at runtime in parsenfsfh.c

The error was:
parsenfsfh.c:359:37: runtime error: left shift of 170 by 24 places cannot
be represented in type 'int'

6 years agoUpdate config.{guess,sub}, timestamps 2018-07-06,2018-07-03
Francois-Xavier Le Bail [Tue, 10 Jul 2018 11:12:45 +0000 (13:12 +0200)] 
Update config.{guess,sub}, timestamps 2018-07-06,2018-07-03

From repository git://git.savannah.gnu.org/config.git

6 years agoAdd a test from Kamil Frankowicz for the BFD dissector.
Guy Harris [Tue, 10 Jul 2018 08:07:25 +0000 (01:07 -0700)] 
Add a test from Kamil Frankowicz for the BFD dissector.

6 years ago Clean up handling of different packet types.
Guy Harris [Tue, 10 Jul 2018 08:01:15 +0000 (01:01 -0700)] 
 Clean up handling of different packet types.

Only look at the header for control packets; we don't know what the
payload contains for other packet types.

This fixes some cases where we fail to check whether we have a full
header before fetching from the header - we only need to fetch from the
header for control packets, so we now only need to check that we have it
for control packets; make sure we *don't* look at the header for other
packet types.

Update the v0 code to match draft-ietf-bfd-base-01, which was the last
draft that discussed v0.

6 years agoUpdate the timestamp in the man page.
Denis Ovsienko [Tue, 10 Jul 2018 07:38:04 +0000 (08:38 +0100)] 
Update the timestamp in the man page.

[skip ci]

6 years agoPointers to packet bytes should be u_char *, not void *
Francois-Xavier Le Bail [Tue, 10 Jul 2018 06:05:53 +0000 (08:05 +0200)] 
Pointers to packet bytes should be u_char *, not void *

6 years agoICMPv6: Fix printing 'Reachable Time' and 'Retrans Timer' as milliseconds
Francois-Xavier Le Bail [Mon, 9 Jul 2018 13:39:44 +0000 (15:39 +0200)] 
ICMPv6: Fix printing 'Reachable Time' and 'Retrans Timer' as milliseconds

Update 'retrans time' to 'retrans timer'.

See: https://tools.ietf.org/html/rfc4861#section-4.2.

Update the output of some tests accordingly.

6 years agoClean up dissection.
Guy Harris [Mon, 9 Jul 2018 16:42:17 +0000 (09:42 -0700)] 
Clean up dissection.

Don't use pointers to anything other than octets; there is no guarantee
that the L2TP packet is aligned on a 2-byte or 4-byte boundary, and
there is no need to pretend that we have pointers to aligned values -
we're using the EXTRACT_ macros, which will fetch multi-byte integral
values regardless of the alignment of the pointer.

This also fixes some cases where we were advancing 2 bytes after
processing a 1-byte field - we were incrementing a uint16_t * by 1,
which means advancing it by 2 bytes, and we're now incrementing the
uint8_t * by 1.

Don't cast a 4-byte integer to u_long - EXTRACT_BE_U_4() is guaranteed
to return something printable with %u.

Don't fetch fields dividded into "high" and "low" portions 2 bytes at a
time and reassemble them; the only reason they're divided into "high"
and "low" partitions in the ASCII-art diagrams in RFC 2661 is that those
diagrams tend to show packets in the form of 32-bit words, and those
fields aren't aligned on 32-bit word boundaries, so we can just fetch
those fields with EXTRACT_BE_U_4().

Don't print a sequence of AVPs by recursion; iterate instead.

Add some RFC numbers while we're at it.

6 years agoUse HTTPS in the www.tcpdump.org URLs.
Denis Ovsienko [Mon, 9 Jul 2018 10:04:39 +0000 (11:04 +0100)] 
Use HTTPS in the www.tcpdump.org URLs.

[skip ci]

6 years agoUse EXTRACT_ macros, don't reassemble multi-byte quantities ourselves.
Guy Harris [Sun, 8 Jul 2018 23:50:16 +0000 (16:50 -0700)] 
Use EXTRACT_ macros, don't reassemble multi-byte quantities ourselves.

6 years agoESP: Fix some unreachable code warnings
Francois-Xavier Le Bail [Sun, 8 Jul 2018 18:01:46 +0000 (20:01 +0200)] 
ESP: Fix some unreachable code warnings

Found with -Wunreachable-code clang compiler option.

The errors were:
./print-esp.c:263:3: warning: code will never be executed
                                                 [-Wunreachable-code]
                free(input_buffer);
                ^~~~
./print-esp.c:246:3: warning: code will never be executed
                                                 [-Wunreachable-code]
                EVP_CIPHER_CTX_free(ctx);
                ^~~~~~~~~~~~~~~~~~~
./print-esp.c:843:5: warning: code will never be executed
                                                 [-Wunreachable-code]
                                free(input_buffer);
                                ^~~~
./print-esp.c:826:5: warning: code will never be executed
                                                 [-Wunreachable-code]
                                EVP_CIPHER_CTX_free(ctx);
                                ^~~~~~~~~~~~~~~~~~~

6 years agoDVMRP: Fix an undefined behavior at runtime
Francois-Xavier Le Bail [Sun, 8 Jul 2018 13:03:45 +0000 (15:03 +0200)] 
DVMRP: Fix an undefined behavior at runtime

Found with -fsanitize=undefined clang compiler option.

The error was:
print-dvmrp.c:238:27: runtime error: left shift of 240 by 24 places cannot
be represented in type 'int'

6 years agoSort the tested compiler warning options
Francois-Xavier Le Bail [Sat, 7 Jul 2018 20:01:00 +0000 (22:01 +0200)] 
Sort the tested compiler warning options

6 years agosyslog: fix a typo in a comment
Denis Ovsienko [Fri, 6 Jul 2018 16:55:31 +0000 (16:55 +0000)] 
syslog: fix a typo in a comment

[skip ci]

6 years agoAdd a missing space for DNS over TCP (GH #688)
Denis Ovsienko [Fri, 6 Jul 2018 13:46:13 +0000 (13:46 +0000)] 
Add a missing space for DNS over TCP (GH #688)

[skip ci]

6 years agoNo need to check whether data is present if there isn't any data.
Guy Harris [Mon, 25 Jun 2018 05:07:46 +0000 (22:07 -0700)] 
No need to check whether data is present if there isn't any data.

6 years agoupdate CREDITS
Denis Ovsienko [Sun, 24 Jun 2018 16:26:45 +0000 (17:26 +0100)] 
update CREDITS

Move 3 past maintainers to the respective section, fixup formatting for
consistency and specify ordering within sections.

[skip ci]

6 years agoICMPv6: Add a length check
Francois-Xavier Le Bail [Sat, 23 Jun 2018 17:08:19 +0000 (19:08 +0200)] 
ICMPv6: Add a length check

If the length is zero, it's invalid, print that.

Add a test with this case.

6 years agoGet rid of no-longer-used nfsuint64.
Guy Harris [Sat, 23 Jun 2018 07:57:39 +0000 (00:57 -0700)] 
Get rid of no-longer-used nfsuint64.

nd_uint64_t suffices - it doesn't require 8-byte alignment (XDR doesn't
provide 8-byte alignment for 64-bit quantities).

6 years agoUse nd_uint types for structures used to overlay packets.
Guy Harris [Sat, 23 Jun 2018 00:19:18 +0000 (17:19 -0700)] 
Use nd_uint types for structures used to overlay packets.

6 years agoClean up processing of RPC request header.
Guy Harris [Fri, 22 Jun 2018 22:28:10 +0000 (15:28 -0700)] 
Clean up processing of RPC request header.

Don't just blast through it and do a single check at the end to make
sure we didn't run past the end of the packet; check for the
fixed-length part of the credentials, then check for the variable-length
part of the credentials, and then do the same two steps for the
verifier.

Fix the checks against the on-the-network length while we're at it.

6 years agoMake roundup2() generally available.
Guy Harris [Fri, 22 Jun 2018 18:18:20 +0000 (11:18 -0700)] 
Make roundup2() generally available.

6 years agoExpand a comment.
Guy Harris [Thu, 21 Jun 2018 22:01:34 +0000 (15:01 -0700)] 
Expand a comment.

6 years agoFix test for truncated sname and file.
Guy Harris [Thu, 21 Jun 2018 21:54:02 +0000 (14:54 -0700)] 
Fix test for truncated sname and file.

nd_printztn() returns 0 if the string is truncated; check for it
returning zero, not for returning a non-zero value.

This fix was supplied in GitHub issue #685.

6 years agoRIP: Add some bounds checks
Francois-Xavier Le Bail [Wed, 20 Jun 2018 07:09:14 +0000 (09:09 +0200)] 
RIP: Add some bounds checks

6 years agoIEEE 802.11: Add a bounds check
Francois-Xavier Le Bail [Mon, 18 Jun 2018 19:47:43 +0000 (21:47 +0200)] 
IEEE 802.11: Add a bounds check

6 years agoAll four BSDs.
Guy Harris [Mon, 18 Jun 2018 03:22:11 +0000 (20:22 -0700)] 
All four BSDs.

6 years agoAdd some EXTRACT_U_1() macro calls
Francois-Xavier Le Bail [Sat, 16 Jun 2018 12:39:33 +0000 (14:39 +0200)] 
Add some EXTRACT_U_1() macro calls

6 years agoAdd two EXTRACT_U_1() macro calls
Francois-Xavier Le Bail [Sat, 16 Jun 2018 12:25:06 +0000 (14:25 +0200)] 
Add two EXTRACT_U_1() macro calls

6 years agoFix a typo in the EXTRACT_BE_S_6() macro
Francois-Xavier Le Bail [Fri, 15 Jun 2018 12:33:47 +0000 (14:33 +0200)] 
Fix a typo in the EXTRACT_BE_S_6() macro

S: Signed

6 years agoUpdate an email address
Francois-Xavier Le Bail [Wed, 13 Jun 2018 15:49:23 +0000 (17:49 +0200)] 
Update an email address

6 years agoAdd more nd_print_trunc() calls
Francois-Xavier Le Bail [Wed, 6 Jun 2018 13:00:10 +0000 (15:00 +0200)] 
Add more nd_print_trunc() calls

Update the output of some tests accordingly.

6 years agoInclude conditionally <config.h> in netdissect-alloc.c
Francois-Xavier Le Bail [Tue, 5 Jun 2018 12:19:33 +0000 (14:19 +0200)] 
Include conditionally <config.h> in netdissect-alloc.c

This should suppress the warning reported by Gisle Vanem:

In file included from netdissect-alloc.c:18:
In file included from ./netdissect-alloc.h:22:
./netdissect.h(131,14):  warning: '_strdup' redeclared without 'dllimport'
    attribute: previous 'dllimport' ignored [-Winconsistent-dllimport]
extern char *strdup (const char *str);
             ^
./netdissect-stdinc.h(219,18):  note: expanded from macro 'strdup'
  #define strdup _strdup
                 ^

6 years agoIP: Stop decoding when truncation occurs in options
Francois-Xavier Le Bail [Mon, 4 Jun 2018 15:06:45 +0000 (17:06 +0200)] 
IP: Stop decoding when truncation occurs in options

We just keep the checksum control.

6 years agoUDP: Add two bounds checks
Francois-Xavier Le Bail [Mon, 4 Jun 2018 11:46:02 +0000 (13:46 +0200)] 
UDP: Add two bounds checks

6 years agoICMPv6: Avoid reinventing ND_TCHECK_*() macros
Francois-Xavier Le Bail [Sun, 3 Jun 2018 15:36:40 +0000 (17:36 +0200)] 
ICMPv6: Avoid reinventing ND_TCHECK_*() macros

6 years agoIP: Print clearer when the version is invalid
Francois-Xavier Le Bail [Sun, 3 Jun 2018 10:02:02 +0000 (12:02 +0200)] 
IP: Print clearer when the version is invalid

Update the output of some tests accordingly.

6 years agoSUNRPC: Add a bounds check
Francois-Xavier Le Bail [Sat, 2 Jun 2018 21:38:18 +0000 (23:38 +0200)] 
SUNRPC: Add a bounds check

6 years agoUDP: Add a bounds check
Francois-Xavier Le Bail [Sat, 2 Jun 2018 14:31:49 +0000 (16:31 +0200)] 
UDP: Add a bounds check

6 years agoVJC: Add some bounds checks
Francois-Xavier Le Bail [Sat, 2 Jun 2018 11:51:01 +0000 (13:51 +0200)] 
VJC: Add some bounds checks

6 years agoMPTCP: Add a bounds check
Francois-Xavier Le Bail [Sat, 2 Jun 2018 07:32:56 +0000 (09:32 +0200)] 
MPTCP: Add a bounds check

6 years agoSimplify some expressions
Francois-Xavier Le Bail [Fri, 1 Jun 2018 20:06:42 +0000 (22:06 +0200)] 
Simplify some expressions

In the equality case, the difference is also zero.

6 years agoAdd more nd_print_trunc() calls
Francois-Xavier Le Bail [Fri, 1 Jun 2018 13:56:06 +0000 (15:56 +0200)] 
Add more nd_print_trunc() calls

Update the output of some tests accordingly.

Moreover:
Add a ndo_protocol assignment in pimv2_print().

6 years agoDCCP: Fix a truncation message
Francois-Xavier Le Bail [Tue, 29 May 2018 16:26:14 +0000 (18:26 +0200)] 
DCCP: Fix a truncation message

It's a truncated packet, not sure it's invalid.

6 years agoMake the NFLOG test case unconditional
Francois-Xavier Le Bail [Tue, 29 May 2018 10:38:39 +0000 (12:38 +0200)] 
Make the NFLOG test case unconditional

There is no more HAVE_PCAP_NFLOG_H macro to test.

libpcap has support for NFLOG in current in 1.8.1 and in old releases
1.7.4, 1.6.2 and 1.5.3.

Thus there should be no problem to always do the test.

6 years agoAdd a nd_print_trunc() call
Francois-Xavier Le Bail [Tue, 29 May 2018 09:11:46 +0000 (11:11 +0200)] 
Add a nd_print_trunc() call

Update the output of a test accordingly.

6 years agoES-IS,IS-IS: Add two missing return
Francois-Xavier Le Bail [Fri, 25 May 2018 12:53:08 +0000 (14:53 +0200)] 
ES-IS,IS-IS: Add two missing return

Update the output of some tests accordingly.

6 years agoUDP: Add two missing return
Francois-Xavier Le Bail [Fri, 25 May 2018 11:21:31 +0000 (13:21 +0200)] 
UDP: Add two missing return

6 years agoBluetooth: Add a missing return
Francois-Xavier Le Bail [Fri, 25 May 2018 09:38:54 +0000 (11:38 +0200)] 
Bluetooth: Add a missing return

6 years agoWe no longer need pcap/nflog.h nor pcap/bluetooth.h, step 2
Francois-Xavier Le Bail [Fri, 25 May 2018 08:03:43 +0000 (10:03 +0200)] 
We no longer need pcap/nflog.h nor pcap/bluetooth.h, step 2

6 years agoRemove trailing spaces/tabs
Francois-Xavier Le Bail [Fri, 25 May 2018 07:56:04 +0000 (09:56 +0200)] 
Remove trailing spaces/tabs

6 years agoUpdate closing #endif comment.
Guy Harris [Thu, 24 May 2018 21:13:48 +0000 (14:13 -0700)] 
Update closing #endif comment.

6 years agoWe no longer need pcap/nflog.h nor pcap/bluetooth.h.
Guy Harris [Thu, 24 May 2018 21:13:22 +0000 (14:13 -0700)] 
We no longer need pcap/nflog.h nor pcap/bluetooth.h.

6 years agoCast dport and sport to u_int before shifting them.
Guy Harris [Thu, 24 May 2018 19:11:09 +0000 (12:11 -0700)] 
Cast dport and sport to u_int before shifting them.

The result of the expression is ultimately going to be put into a u_int;
cast them to u_int so that we'll be shifting unsigned values left rather
than int values, to avoid undefined behavior.

This should fix GitHub issue #681.

6 years agoEncrypted data buffer sizes must also be a multiple of the cipher block size.
Guy Harris [Thu, 24 May 2018 18:45:19 +0000 (11:45 -0700)] 
Encrypted data buffer sizes must also be a multiple of the cipher block size.

This should address the issue in GitHub pull request #680.

6 years agoDeclare the NFLOG pseudo-header ourselves.
Guy Harris [Wed, 23 May 2018 21:43:47 +0000 (14:43 -0700)] 
Declare the NFLOG pseudo-header ourselves.

It's not specified by a libpcap header that might have a different
layout in different pcap releases, it's specified on the list of
link-layer header types and must remain the same forever (except for
getting additional bits defined), so we don't need to pick it up from
libpcap.

This means we get to use tcpdump's nd_ types; do so.