]> The Tcpdump Group git mirrors - tcpdump/log
tcpdump
6 years agoIEEE 802.15.4: Fix two loops for undefined behavior at runtime
Francois-Xavier Le Bail [Mon, 25 Mar 2019 21:10:19 +0000 (22:10 +0100)] 
IEEE 802.15.4: Fix two loops for undefined behavior at runtime

The errors were:
print-802_15_4.c:433:17: runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'u_int' (aka 'unsigned int')
print-802_15_4.c:483:17: runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'u_int' (aka 'unsigned int')

6 years agoMerge branch 'kivinen-master'
Michael Richardson [Sun, 24 Mar 2019 08:09:26 +0000 (09:09 +0100)] 
Merge branch 'kivinen-master'

6 years agoMerge branch 'master' of https://github.com/kivinen/tcpdump into kivinen-master
Michael Richardson [Sun, 24 Mar 2019 08:05:06 +0000 (09:05 +0100)] 
Merge branch 'master' of https://github.com/kivinen/tcpdump into kivinen-master

6 years agoMerge pull request #733 from marka63/dns-get-extended-rcode
Michael Richardson [Sat, 23 Mar 2019 14:32:00 +0000 (10:32 -0400)] 
Merge pull request #733 from marka63/dns-get-extended-rcode

Extract extend DNS rcode from OPT record.

6 years agoTravis CI: Use ccache and parallel make.
Denis Ovsienko [Thu, 21 Mar 2019 23:02:44 +0000 (23:02 +0000)] 
Travis CI: Use ccache and parallel make.

6 years agoTravis CI: Add debug infos
Francois-Xavier Le Bail [Thu, 21 Mar 2019 15:26:51 +0000 (16:26 +0100)] 
Travis CI: Add debug infos

Add a folded 'cat Makefile' (without the mkdep part for autotools).
Add a folded 'cat config.h'.
Add a folded 'cat config.log' (for autotools).

The 'sleep 10' command is a workaround for a display problem on osx.

6 years agoLMP: Fix a loop for undefined behavior at runtime
Francois-Xavier Le Bail [Wed, 20 Mar 2019 20:18:20 +0000 (21:18 +0100)] 
LMP: Fix a loop for undefined behavior at runtime

The error was:
print-lmp.c:1132:13: runtime error: unsigned integer overflow: 249 - 516
cannot be represented in type 'unsigned int'

Update the output of a test accordingly.

6 years agoLMP: Rename a variable
Francois-Xavier Le Bail [Wed, 20 Mar 2019 08:28:08 +0000 (09:28 +0100)] 
LMP: Rename a variable

Use 'length' as in most similar cases.

6 years agoPPP: Update two error messages
Francois-Xavier Le Bail [Wed, 20 Mar 2019 12:46:55 +0000 (13:46 +0100)] 
PPP: Update two error messages

Update the output of a test accordingly.

6 years agoRIP: Update two error messages
Francois-Xavier Le Bail [Wed, 20 Mar 2019 12:31:47 +0000 (13:31 +0100)] 
RIP: Update two error messages

Update the output of a test accordingly.

6 years agoBluetooth: Print the protocol name
Francois-Xavier Le Bail [Tue, 19 Mar 2019 13:53:09 +0000 (14:53 +0100)] 
Bluetooth: Print the protocol name

6 years agoAdd the nd_print_protocol() function
Francois-Xavier Le Bail [Tue, 19 Mar 2019 13:49:34 +0000 (14:49 +0100)] 
Add the nd_print_protocol() function

Use the ndo->ndo_protocol field to print the protocol name.

6 years agoSquelch a clang warning
Francois-Xavier Le Bail [Tue, 19 Mar 2019 09:39:06 +0000 (10:39 +0100)] 
Squelch a clang warning

The warning was:
./tcpdump.c:182:5: warning: no previous extern declaration for non-static
variable 'dflag' [-Wmissing-variable-declarations]

6 years agoPPP: Fix two loops for undefined behavior at runtime
Francois-Xavier Le Bail [Mon, 18 Mar 2019 21:51:44 +0000 (22:51 +0100)] 
PPP: Fix two loops for undefined behavior at runtime

The errors were:
print-ppp.c:518:9: runtime error: unsigned integer overflow: 38 - 230
cannot be represented in type 'unsigned int'
print-ppp.c:1138:63: runtime error: unsigned integer overflow: 204 - 220
cannot be represented in type 'unsigned int'

Add a test case.

6 years agoPPP: Fix inaccurate variable names
Francois-Xavier Le Bail [Mon, 18 Mar 2019 21:10:13 +0000 (22:10 +0100)] 
PPP: Fix inaccurate variable names

6 years agoClean up whitespaces
Francois-Xavier Le Bail [Mon, 18 Mar 2019 21:16:29 +0000 (22:16 +0100)] 
Clean up whitespaces

6 years agoNFS: Fix an undefined behavior at runtime
Francois-Xavier Le Bail [Sun, 17 Mar 2019 20:23:07 +0000 (21:23 +0100)] 
NFS: Fix an undefined behavior at runtime

The error was:
print-nfs.c:537:2: runtime error: unsigned integer overflow:
4294967295 + 3 cannot be represented in type 'unsigned int'
print-nfs.c:541:14: runtime error: unsigned integer overflow:
4294967295 + 3 cannot be represented in type 'unsigned int'

Add a test case.

6 years agoCDP: Fix two loops for undefined behavior at runtime
Francois-Xavier Le Bail [Sun, 17 Mar 2019 14:01:15 +0000 (15:01 +0100)] 
CDP: Fix two loops for undefined behavior at runtime

The errors were:
print-cdp.c:363:13: runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'u_int' (aka 'unsigned int')
print-cdp.c:375:13: runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'u_int' (aka 'unsigned int')

6 years agoBRCMTAG: Fix some warnings
Francois-Xavier Le Bail [Sat, 16 Mar 2019 16:25:19 +0000 (17:25 +0100)] 
BRCMTAG: Fix some warnings

The warnings were:
no previous extern declaration for non-static variable 'brcm_tag_te_values'
[-Wmissing-variable-declarations]
no previous extern declaration for non-static variable 'brcm_tag_rc_values'
[-Wmissing-variable-declarations]

6 years agoICMPv6: Add the IPv6-Only flag
Loganaden Velvindron [Sat, 16 Mar 2019 11:31:26 +0000 (15:31 +0400)] 
ICMPv6: Add the IPv6-Only flag

This flag in defined in a draft which is close to getting published as
an IETF RFC: https://tools.ietf.org/html/draft-ietf-6man-ipv6only-flag-05.

6 years agoSNMP: Fix an undefined behavior at runtime
Francois-Xavier Le Bail [Sat, 16 Mar 2019 12:08:36 +0000 (13:08 +0100)] 
SNMP: Fix an undefined behavior at runtime

The error was:
print-snmp.c:503:14: runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'uint32_t' (aka 'unsigned int')

6 years agoTravis CI: Print the devel libs in Linux builds
Francois-Xavier Le Bail [Fri, 15 Mar 2019 14:49:48 +0000 (15:49 +0100)] 
Travis CI: Print the devel libs in Linux builds

6 years agoTravis CI: Fix the problem with folded outputs
Francois-Xavier Le Bail [Fri, 15 Mar 2019 14:35:59 +0000 (15:35 +0100)] 
Travis CI: Fix the problem with folded outputs

Trailing newlines are now needed in travis_fold:start:* strings, because
of a Travis change.
Based on Travis support proposal.

6 years agoIPX: Add a length check
Francois-Xavier Le Bail [Mon, 11 Mar 2019 21:07:06 +0000 (22:07 +0100)] 
IPX: Add a length check

This fix an undefined behavior at runtime.

The error was:
print-ipx.c:93:43: runtime error: unsigned integer overflow: 29 - 30
cannot be represented in type 'unsigned int'

Add a test case.

6 years agoIS-IS: Fix inaccurate variable names
Francois-Xavier Le Bail [Sun, 10 Mar 2019 22:16:27 +0000 (23:16 +0100)] 
IS-IS: Fix inaccurate variable names

6 years agoAdd two TFTP tests
Francois-Xavier Le Bail [Sun, 10 Mar 2019 15:05:26 +0000 (16:05 +0100)] 
Add two TFTP tests

There is one pcap file with two outputs, with/without the '-T tftp' option.

6 years agoTFTP: Print protocol name and length keyword
Francois-Xavier Le Bail [Sun, 10 Mar 2019 14:34:18 +0000 (15:34 +0100)] 
TFTP: Print protocol name and length keyword

Update the output of a test accordingly.

6 years agoBabel: Avoid an unsigned integer underflow
Francois-Xavier Le Bail [Fri, 8 Mar 2019 12:34:39 +0000 (13:34 +0100)] 
Babel: Avoid an unsigned integer underflow

6 years agoSMB: Avoid an unsigned integer underflow
Francois-Xavier Le Bail [Fri, 8 Mar 2019 12:23:34 +0000 (13:23 +0100)] 
SMB: Avoid an unsigned integer underflow

6 years agoRIP: Fix two loops for undefined behavior at runtime
Francois-Xavier Le Bail [Fri, 8 Mar 2019 17:04:43 +0000 (18:04 +0100)] 
RIP: Fix two loops for undefined behavior at runtime

1) RIPv2
The error was:
print-rip.c:386:9: runtime error: unsigned integer overflow: 16 - 20
cannot be represented in type 'unsigned int'

Without this change the unsigned integer variable 'len' is assigned a
very high value, because of underflow, and the loop continue incorrectly.

Add a test case.

2) RIPv1
Same bugfix, based on a code inspection, so comes without a test case.

6 years agoRIP: Fix inaccurate variable names
Francois-Xavier Le Bail [Fri, 8 Mar 2019 14:52:07 +0000 (15:52 +0100)] 
RIP: Fix inaccurate variable names

6 years agoClean up whitespaces/indentation
Francois-Xavier Le Bail [Fri, 8 Mar 2019 14:26:45 +0000 (15:26 +0100)] 
Clean up whitespaces/indentation

6 years agoICMP: Fix an undefined behavior at runtime
Francois-Xavier Le Bail [Fri, 8 Mar 2019 11:46:49 +0000 (12:46 +0100)] 
ICMP: Fix an undefined behavior at runtime

The error was:
print-icmp.c:491:13: runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'u_int' (aka 'unsigned int')

6 years agoUse the ndo->ndo_protocol field instead of the protoname parameter
Francois-Xavier Le Bail [Thu, 7 Mar 2019 21:20:34 +0000 (22:20 +0100)] 
Use the ndo->ndo_protocol field instead of the protoname parameter

Moreover:
Fix a truncated string: "[!" is not the prefix for a truncated string.
Add two comments.
Clean up a whitespace.

6 years agoFix a typo
Francois-Xavier Le Bail [Thu, 7 Mar 2019 13:31:19 +0000 (14:31 +0100)] 
Fix a typo

6 years agoTCP: Fix an undefined behavior at runtime
Francois-Xavier Le Bail [Wed, 6 Mar 2019 13:52:14 +0000 (14:52 +0100)] 
TCP: Fix an undefined behavior at runtime

The error was:
print-tcp.c:831:22: runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'u_int' (aka 'unsigned int')

6 years agoMerge pull request #734 from jkcko/master
Guy Harris [Thu, 28 Feb 2019 17:58:25 +0000 (09:58 -0800)] 
Merge pull request #734 from jkcko/master

Support DLT_IEEE802_15_4_TAP.

6 years agoClean up whitespaces/indentation
Francois-Xavier Le Bail [Wed, 27 Feb 2019 20:24:12 +0000 (21:24 +0100)] 
Clean up whitespaces/indentation

6 years agoISAKMP: Simplify an expression
Francois-Xavier Le Bail [Wed, 27 Feb 2019 19:31:02 +0000 (20:31 +0100)] 
ISAKMP: Simplify an expression

6 years agoClean up whitespaces
Francois-Xavier Le Bail [Wed, 27 Feb 2019 19:13:59 +0000 (20:13 +0100)] 
Clean up whitespaces

6 years agoAdd two ndo_protocol reassignments after xxx_print() calls
Francois-Xavier Le Bail [Wed, 27 Feb 2019 11:15:06 +0000 (12:15 +0100)] 
Add two ndo_protocol reassignments after xxx_print() calls

6 years agoClean up whitespaces/indentation
Francois-Xavier Le Bail [Wed, 27 Feb 2019 11:03:15 +0000 (12:03 +0100)] 
Clean up whitespaces/indentation

6 years agoIS-IS: Replace some ND_TTEST_*() calls with ND_TCHECK_*() calls
Francois-Xavier Le Bail [Mon, 25 Feb 2019 16:40:02 +0000 (17:40 +0100)] 
IS-IS: Replace some ND_TTEST_*() calls with ND_TCHECK_*() calls

6 years agoIEEE 802.11: Replace some ND_TTEST_*() calls with ND_TCHECK_*() calls
Francois-Xavier Le Bail [Sun, 24 Feb 2019 09:47:24 +0000 (10:47 +0100)] 
IEEE 802.11: Replace some ND_TTEST_*() calls with ND_TCHECK_*() calls

Moreover:
Use 'goto trunc' in some length tests.

6 years agoClean up whitespaces/indentation
Francois-Xavier Le Bail [Sun, 24 Feb 2019 08:44:14 +0000 (09:44 +0100)] 
Clean up whitespaces/indentation

6 years agoRSVP: Replace a ND_TTEST_*() call with ND_TCHECK_*() call
Francois-Xavier Le Bail [Sat, 23 Feb 2019 21:31:06 +0000 (22:31 +0100)] 
RSVP: Replace a ND_TTEST_*() call with ND_TCHECK_*() call

6 years agoGeoNet: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls
Francois-Xavier Le Bail [Sat, 23 Feb 2019 18:55:18 +0000 (19:55 +0100)] 
GeoNet: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls

Moreover:
Add two comments

6 years agoClean up whitespaces
Francois-Xavier Le Bail [Sat, 23 Feb 2019 18:51:59 +0000 (19:51 +0100)] 
Clean up whitespaces

6 years agoOLSR: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls
Francois-Xavier Le Bail [Sat, 23 Feb 2019 18:27:37 +0000 (19:27 +0100)] 
OLSR: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls

6 years agoGRE: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls
Francois-Xavier Le Bail [Sat, 23 Feb 2019 17:05:36 +0000 (18:05 +0100)] 
GRE: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls

6 years agoClean up whitespaces/indentation
Francois-Xavier Le Bail [Sat, 23 Feb 2019 16:31:48 +0000 (17:31 +0100)] 
Clean up whitespaces/indentation

6 years agoHandle DLT_IEEE802_15_4_TAP. 734/head
James Ko [Fri, 15 Feb 2019 20:27:46 +0000 (12:27 -0800)] 
Handle DLT_IEEE802_15_4_TAP.

https://github.com/jkcko/ieee802.15.4-tap

6 years agoAdd dns-badvers test case. 733/head
Mark Andrews [Wed, 13 Feb 2019 01:27:59 +0000 (12:27 +1100)] 
Add dns-badvers test case.

6 years agoAdd dns-badcookie test case.
Mark Andrews [Wed, 13 Feb 2019 01:19:50 +0000 (12:19 +1100)] 
Add dns-badcookie test case.

6 years agoExtract extend DNS rcode from OPT record and print it.
Mark Andrews [Tue, 12 Feb 2019 22:50:17 +0000 (09:50 +1100)] 
Extract extend DNS rcode from OPT record and print it.

6 years agoAdd a test for NFS write verifier cookie in TESTLIST
Francois-Xavier Le Bail [Thu, 7 Feb 2019 11:36:04 +0000 (12:36 +0100)] 
Add a test for NFS write verifier cookie in TESTLIST

This is a followup to commit 8b9f7d9d76.

Moreover:
Rename the .pcap file to .pcapng.

6 years agoRemove some useless spaces
Francois-Xavier Le Bail [Fri, 1 Feb 2019 12:59:45 +0000 (13:59 +0100)] 
Remove some useless spaces

6 years agoRemove a useless space
Francois-Xavier Le Bail [Tue, 29 Jan 2019 20:39:41 +0000 (21:39 +0100)] 
Remove a useless space

6 years agoChange some pcap tests to test the printers again
Francois-Xavier Le Bail [Tue, 29 Jan 2019 13:27:06 +0000 (14:27 +0100)] 
Change some pcap tests to test the printers again

The added sanity check was: packet length >= capture length.

Thus update packet length to be capture length if lower.

This change is a followup to commit 9e6ba479d8.

6 years agoMerge pull request #722 from aieri/issue/695
Guy Harris [Tue, 29 Jan 2019 02:29:37 +0000 (18:29 -0800)] 
Merge pull request #722 from aieri/issue/695

Amend documentation about the use of the -C -G and -W switches.

6 years agoMerge pull request #703 from nmap/update-gitignore
Guy Harris [Tue, 29 Jan 2019 02:27:48 +0000 (18:27 -0800)] 
Merge pull request #703 from nmap/update-gitignore

Add files generated by CMake on Windows to .gitignore

6 years agoMerge pull request #728 from ffainelli/brcm-tag
Guy Harris [Tue, 29 Jan 2019 00:11:13 +0000 (16:11 -0800)] 
Merge pull request #728 from ffainelli/brcm-tag

Add support for dissecting Broadcom tags

6 years agoAdd Broadcom tags tests 728/head
Florian Fainelli [Sat, 26 Jan 2019 00:58:42 +0000 (16:58 -0800)] 
Add Broadcom tags tests

Add 3 tests to test that we can properly dissect Broadcom tags. Two are
for DSA_TAG_BRCM where the tag is between Ethernet MAC SA and
Type/Length and one for DSA_TAG_BRCM_PREPEND where the tag is
encapsulating the Ethernet frame (thus requires -e to be shown).

6 years agoAdd support for decoding Broadcom Ethernet switches tags
Florian Fainelli [Fri, 18 Jan 2019 23:24:33 +0000 (15:24 -0800)] 
Add support for decoding Broadcom Ethernet switches tags

This adds support for decoding the Broadcom Ethernet switches tags which
are are 4byte in length and are located between the Ethernet MAC SA and
the Type/Length field (DSA_TAG_BRCM) as well as the pre-pended Broadcom
tag (DSA_TAG_BRCM_PREPEND) which are located in front of the standard
Ethernet header.

This makes use of the recently introduced ether_print_hdr_len() to allow
specifying the non-standard Ethernet header length of 12 + 4 + 2 bytes.

6 years agoReport 32-bit timestamps with uppermost bit set as "Error converting time"
Francois-Xavier Le Bail [Sun, 27 Jan 2019 14:46:05 +0000 (15:46 +0100)] 
Report 32-bit timestamps with uppermost bit set as "Error converting time"

In the ts_unix_print() function.

This change is a followup to commit 8e9fb1eb02.

6 years agoEthernet: Allow specifying non-standard Ethernet header length
Florian Fainelli [Fri, 18 Jan 2019 23:19:38 +0000 (15:19 -0800)] 
Ethernet: Allow specifying non-standard Ethernet header length

A fair number of proprietary Ethernet switch tagging protocols, such as
Broadcom tags for instance, will place their tag between the MAC SA and
the Type/Length field.

Move the body of ether_print() into ether_print_hdr_len() and specify
the Ethernet header length as an argument to that function.
ether_print() calls ether_print_hdr_len() with a standard Ethernet
header lenght of 14 bytes, while other callers could specify an
arbitrary length. We still assume that the first Length/Type field to
parse is located 2 bytes before the end of that Ethernet header length.

This will be used in a subsequent commit to parse Broadcom tags.

6 years agoFix small misspellings 730/head
Antonin Décimo [Wed, 23 Jan 2019 16:28:14 +0000 (17:28 +0100)] 
Fix small misspellings

6 years agoUpdate print-lldp.c 729/head
Matt Eaton [Tue, 22 Jan 2019 11:53:19 +0000 (05:53 -0600)] 
Update print-lldp.c

Small typo fix for `EVB Station` in Link Layer Discovery Protocol (LLDP) printer - `print-lldp.c`

6 years agoDo AppVeyor builds on all branches.
Guy Harris [Wed, 9 Jan 2019 18:12:12 +0000 (10:12 -0800)] 
Do AppVeyor builds on all branches.

6 years agoBuild the tcpdump-4.9 branch as well.
Guy Harris [Wed, 9 Jan 2019 09:24:29 +0000 (01:24 -0800)] 
Build the tcpdump-4.9 branch as well.

6 years agoHandle rpcaps:// URLs as well, for rpcap-over-TLS.
Guy Harris [Mon, 7 Jan 2019 02:30:59 +0000 (18:30 -0800)] 
Handle rpcaps:// URLs as well, for rpcap-over-TLS.

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 agoFixed more warnings. 597/head
Tero Kivinen [Sat, 17 Nov 2018 23:18:43 +0000 (01:18 +0200)] 
Fixed more warnings.

6 years agoFixed some warnings, added print-zep.c to CMakeLists
Tero Kivinen [Sat, 17 Nov 2018 22:34:33 +0000 (00:34 +0200)] 
Fixed some warnings, added print-zep.c to CMakeLists

6 years agoRemoved some warnings
Tero Kivinen [Sat, 17 Nov 2018 22:10:56 +0000 (00:10 +0200)] 
Removed some warnings

6 years agoUpdated 802.15.4 code
Tero Kivinen [Sat, 17 Nov 2018 21:35:46 +0000 (04:35 +0700)] 
Updated 802.15.4 code

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