]> The Tcpdump Group git mirrors - tcpdump/log
tcpdump
3 years agoCI: Add back running tcpdump -J/-L and capture, now with Cirrus VMs. 925/head
Francois-Xavier Le Bail [Wed, 7 Jul 2021 16:37:12 +0000 (18:37 +0200)] 
CI: Add back running tcpdump -J/-L and capture, now with Cirrus VMs.

The Cirrus virtual machines are throwaway.

Revert partially f5739ad4cab362afdebbf3af588e9f05e0e0009b.

3 years agoPrint the supported time stamp types (-J) to stdout instead of stderr
Francois-Xavier Le Bail [Thu, 8 Jul 2021 10:26:36 +0000 (12:26 +0200)] 
Print the supported time stamp types (-J) to stdout instead of stderr

It is not an error, thus print them to stdout.

3 years agoFactorize some code
Francois-Xavier Le Bail [Thu, 8 Jul 2021 09:55:21 +0000 (11:55 +0200)] 
Factorize some code

3 years agoPrint the list of data link types (-L) to stdout instead of stderr
Francois-Xavier Le Bail [Wed, 7 Jul 2021 17:19:37 +0000 (19:19 +0200)] 
Print the list of data link types (-L) to stdout instead of stderr

It is not an error, thus print it to stdout.

3 years ago802.11: make the length in the IE structures a u_int.
Guy Harris [Tue, 6 Jul 2021 20:32:38 +0000 (13:32 -0700)] 
802.11: make the length in the IE structures a u_int.

This avoids narrowing warnings.

Clean up PRINT_RATE() a bit while we're at it (avoiding signed vs.
unsigned comparison warnings).

3 years ago802.11: no need for an element ID in the structures for IEs.
Guy Harris [Tue, 6 Jul 2021 20:27:19 +0000 (13:27 -0700)] 
802.11: no need for an element ID in the structures for IEs.

Remove the element_id member, and, instead of copying over the entire IE
header, just set the length to the value we've already fetched.

3 years agoCI: Get Travis CI vestige sorted in build.sh.
Denis Ovsienko [Mon, 5 Jul 2021 18:37:04 +0000 (19:37 +0100)] 
CI: Get Travis CI vestige sorted in build.sh.

Compiling user-provided source code and running the resulting binary
with sudo was a security problem, thus instead of fixing two no-op
blocks remove them altogether. If anyone later needs to debug features
that require higher privileges, they will need to come up with a better
solution. Simplify the debug output test condition and rephrase the
associated comment for clarity.

3 years agoCI: List shared libraries on more OSes.
Denis Ovsienko [Mon, 5 Jul 2021 17:22:23 +0000 (18:22 +0100)] 
CI: List shared libraries on more OSes.

Running ldd on Linux only originates from the Travis CI setup, where the
OS was either Linux or macOS. However, ldd is available in BSD systems
too, and macOS seems to have its own tool for the same job.

3 years agoAddress all shellcheck warnings in update-test.sh.
Denis Ovsienko [Mon, 5 Jul 2021 13:28:34 +0000 (14:28 +0100)] 
Address all shellcheck warnings in update-test.sh.

3 years agoCI: Lose the output folding props.
Denis Ovsienko [Mon, 5 Jul 2021 11:09:59 +0000 (12:09 +0100)] 
CI: Lose the output folding props.

Same as in libpcap.

3 years agoCI: Switch from bash to POSIX shell.
Denis Ovsienko [Mon, 5 Jul 2021 10:59:03 +0000 (11:59 +0100)] 
CI: Switch from bash to POSIX shell.

Same as in libpcap.

3 years agoCI: Simplify some Coverity Scan props.
Denis Ovsienko [Mon, 5 Jul 2021 10:32:03 +0000 (11:32 +0100)] 
CI: Simplify some Coverity Scan props.

Same as in libpcap.

3 years agoAppVeyor: Update Npcap SDK to 1.10
Francois-Xavier Le Bail [Sun, 4 Jul 2021 07:40:42 +0000 (09:40 +0200)] 
AppVeyor: Update Npcap SDK to 1.10

3 years agoFix the misleading comment regarding "From DS", "To DS" Frame Control Flags
Gokul Sivakumar [Sun, 27 Jun 2021 10:43:06 +0000 (16:13 +0530)] 
Fix the misleading comment regarding "From DS", "To DS" Frame Control Flags

In the case where the "From DS" bit is not set and the "To DS" bit is set
in the Frame Control Bitmask, the comment line in the corresponding if else
block was misleading that the "From DS" bit is set and the "To DS" bit is
not set.

3 years agoJuniper: Add some bounds checks
Francois-Xavier Le Bail [Wed, 23 Jun 2021 05:55:34 +0000 (07:55 +0200)] 
Juniper: Add some bounds checks

Avoid to have p (current pointer on packet data) > ndo->ndo_snapend
in isoclns_print() in some cases.

Define ND_LONGJMP_FROM_TCHECK.
Remove some trunc labels.

3 years agoCHANGES: Set the date for the 4.99.1 release
Francois-Xavier Le Bail [Thu, 10 Jun 2021 16:13:36 +0000 (18:13 +0200)] 
CHANGES: Set the date for the 4.99.1 release

3 years agoautoconf: Find a local libpcap even with rcX directory suffix
Francois-Xavier Le Bail [Mon, 7 Jun 2021 19:01:15 +0000 (21:01 +0200)] 
autoconf: Find a local libpcap even with rcX directory suffix

3 years agoAppVeyor: Update Npcap SDK to 1.07
Francois-Xavier Le Bail [Thu, 3 Jun 2021 11:14:23 +0000 (13:14 +0200)] 
AppVeyor: Update Npcap SDK to 1.07

3 years agoUse quoted include netdissect-stdinc.h instead of angle-bracketed one
Francois-Xavier Le Bail [Wed, 2 Jun 2021 09:22:46 +0000 (11:22 +0200)] 
Use quoted include netdissect-stdinc.h instead of angle-bracketed one

Same as other printers.

3 years agoMakefile.in: Add the shellcheck target
Francois-Xavier Le Bail [Tue, 1 Jun 2021 07:44:41 +0000 (09:44 +0200)] 
Makefile.in: Add the shellcheck target

Run shellcheck on the build.sh and the build_matrix.sh scripts.
(using 'gcc' format: GCC compatible output. See the shellcheck man page)

[skip ci]

3 years agobuild_matrix.sh: Fix a shellcheck warning
Francois-Xavier Le Bail [Mon, 31 May 2021 13:03:09 +0000 (15:03 +0200)] 
build_matrix.sh: Fix a shellcheck warning

The warning was:
Use "${var:?}" to ensure this never expands to /* . [SC2115]

3 years agobuild.sh: Disable a shellcheck error
Francois-Xavier Le Bail [Mon, 31 May 2021 13:01:44 +0000 (15:01 +0200)] 
build.sh: Disable a shellcheck error

We need the $@ expansion.

The error was:
Double quote array expansions to avoid re-splitting elements. [SC2068]

3 years agoMerge Readme.Win32 into doc/README.Win32.md. [skip ci]
Guy Harris [Mon, 31 May 2021 11:47:47 +0000 (04:47 -0700)] 
Merge Readme.Win32 into doc/README.Win32.md. [skip ci]

We should only have one "how to build on Windows" file.

3 years agoMakefile.in: Add the build for release candidates
Francois-Xavier Le Bail [Sun, 30 May 2021 08:40:53 +0000 (10:40 +0200)] 
Makefile.in: Add the build for release candidates

It adds rcX suffix to the version.
This avoid to manually update 'VERSION' and 'configure'.
Same as for libpcap.

3 years agoUpdate config.{guess,sub}, timestamps 2021-01-25,2021-03-10
Francois-Xavier Le Bail [Thu, 27 May 2021 15:26:38 +0000 (17:26 +0200)] 
Update config.{guess,sub}, timestamps 2021-01-25,2021-03-10

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

3 years agoBGP: Use a macro for repeated identical sizeof()
Francois-Xavier Le Bail [Wed, 26 May 2021 09:06:55 +0000 (11:06 +0200)] 
BGP: Use a macro for repeated identical sizeof()

[skip ci]

3 years agoFrame Relay: make the buffer big enough for the biggest message.
Guy Harris [Wed, 26 May 2021 06:25:41 +0000 (23:25 -0700)] 
Frame Relay: make the buffer big enough for the biggest message.

3 years agoCHANGES: list the most recent change. [skip ci]
Guy Harris [Wed, 26 May 2021 05:28:09 +0000 (22:28 -0700)] 
CHANGES: list the most recent change.  [skip ci]

3 years agoFrame Relay: have q922_string() handle errors better.
Guy Harris [Wed, 26 May 2021 05:26:48 +0000 (22:26 -0700)] 
Frame Relay: have q922_string() handle errors better.

Have it return a string indicating an error, rather than a null string.

3 years agoCHANGES: update with additional changes in the 4.99 branch. [skip ci]
Guy Harris [Wed, 26 May 2021 00:53:25 +0000 (17:53 -0700)] 
CHANGES: update with additional changes in the 4.99 branch. [skip ci]

Move some from the 5.0 list to the 4.99 list.

3 years agoARP: fix overwrites of static buffer in q922_string().
Guy Harris [Tue, 25 May 2021 22:22:49 +0000 (15:22 -0700)] 
ARP: fix overwrites of static buffer in q922_string().

Don't call GET_LINKADDR_STRING() twice in a given ND_PRINT() call.

Should address another problem in GitHub issue #919.

3 years agoBGP: Fix overwrites of global 'astostr' temporary buffer
Francois-Xavier Le Bail [Tue, 25 May 2021 16:23:19 +0000 (18:23 +0200)] 
BGP: Fix overwrites of global 'astostr' temporary buffer

Remove the global 'astostr'.

Use a local 'astostr' in the functions that use it.

This should fix GitHub issue #919.

Moreover:
Rename 'asbuf' to 'astostr'.

3 years agoFix a typo
Francois-Xavier Le Bail [Sat, 22 May 2021 12:16:05 +0000 (14:16 +0200)] 
Fix a typo

[skip ci]

3 years agonetdissect.h: Keep the printers declarations names sorted
Francois-Xavier Le Bail [Sat, 22 May 2021 11:41:26 +0000 (13:41 +0200)] 
netdissect.h: Keep the printers declarations names sorted

Moreover:
Declare macsec_print() on one line.
Remove an extra space.

[skip ci]

3 years agoZephyr: Update 'length' type to unsigned
Francois-Xavier Le Bail [Sat, 22 May 2021 07:41:31 +0000 (09:41 +0200)] 
Zephyr: Update 'length' type to unsigned

It is unsigned in the calling function udp_print().

4 years agoDNS: Sync types with IANA
Matthew Martin [Tue, 9 Mar 2021 22:49:46 +0000 (16:49 -0600)] 
DNS: Sync types with IANA

IANA reference:
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml

Remove the UNSPECA type parsing as IANA has that query type number
assigned to NID now.

4 years agosFlow: Add some spaces (style)
Francois-Xavier Le Bail [Mon, 17 May 2021 16:19:40 +0000 (18:19 +0200)] 
sFlow: Add some spaces (style)

[skip ci]

4 years agoAdd support for IPv6 agent in sFlow.
Neelabh [Thu, 3 Sep 2020 17:06:47 +0000 (22:36 +0530)] 
Add support for IPv6 agent in sFlow.

4 years agoIEEE 802.15.4: Add a bounds check
Francois-Xavier Le Bail [Fri, 14 May 2021 18:34:35 +0000 (20:34 +0200)] 
IEEE 802.15.4: Add a bounds check

This avoids to have cp (current pointer on packet data) > ndo->ndo_snapend
in hex_and_ascii_print(), via ndo_default_print(), via ND_DEFAULTPRINT(),
in some cases.

4 years agoIEEE 802.15.4: Add some bounds checks
Francois-Xavier Le Bail [Tue, 11 May 2021 10:21:28 +0000 (12:21 +0200)] 
IEEE 802.15.4: Add some bounds checks

This avoids to have cp (current pointer on packet data) > ndo->ndo_snapend
in hex_and_ascii_print(), via ndo_default_print(), via ND_DEFAULTPRINT(),
in some cases.

4 years agoRecommend using the upstream CI in CONTRIBUTING. [skip ci]
Denis Ovsienko [Tue, 11 May 2021 22:41:31 +0000 (23:41 +0100)] 
Recommend using the upstream CI in CONTRIBUTING. [skip ci]

CI configuration is a running target, and much of it works on Buildbot,
in which pull requests are the only practicable option for 3rd parties.

4 years agoZEP: Add a bounds check
Francois-Xavier Le Bail [Sun, 9 May 2021 17:48:01 +0000 (19:48 +0200)] 
ZEP: Add a bounds check

This avoids to have cp (current pointer on packet data) > ndo->ndo_snapend
in hex_and_ascii_print(), via ndo_default_print(), via ND_DEFAULTPRINT(),
in some cases.

4 years agoEthernet: Add a bounds check
Francois-Xavier Le Bail [Thu, 6 May 2021 11:39:10 +0000 (13:39 +0200)] 
Ethernet: Add a bounds check

Avoid to have p (current pointer on packet data) > ndo->ndo_snapend
in isoclns_print() in some cases.

Moreover:
Add a "FIXME" comment.

4 years agoMPTCP: parse MPC data_len field
Paolo Abeni [Tue, 23 Mar 2021 17:29:45 +0000 (18:29 +0100)] 
MPTCP: parse MPC data_len field

The RFC 8684 introduced a new field in the MPC header: the data_len.
If the client has not seen yet a DSS sub-option from the server, it
must use MPC with data_lan instead of a DSS for the first packet
carrying a data payload.

This change print the data_len, if present, after the receiver_key.

The field is already there in the existent pcap test trace, we just
need to update the expected output.

Signed-off-by: Paolo Abeni <[email protected]>
4 years agoHaiku is a supported platform. [skip ci]
Denis Ovsienko [Thu, 6 May 2021 09:07:39 +0000 (10:07 +0100)] 
Haiku is a supported platform. [skip ci]

Haiku R1/Beta 2 includes tcpdump and libpcap, even though these seem to
disregard any specified pcap filter expressions.

~> uname -a
Haiku shredder 1 hrev54154+111 Jun  7 2020 07:16 x86_64 x86_64 Haiku
~> tcpdump --version
tcpdump version 4.9.2
libpcap version 1.8.1

4 years agoRemove PLATFORMS (was merged into README.md)
Francois-Xavier Le Bail [Sun, 25 Apr 2021 18:37:28 +0000 (20:37 +0200)] 
Remove PLATFORMS (was merged into README.md)

[skip ci]

4 years agoman: Update DNS sections
Francois-Xavier Le Bail [Sun, 25 Apr 2021 18:05:45 +0000 (20:05 +0200)] 
man: Update DNS sections

The DNS transactions also take place over TCP.

Harmonize text: s/not including/excluding/ like in Name Server Responses
section.

[skip ci]

4 years agoRefine README.md and some related files. [skip ci]
Denis Ovsienko [Fri, 16 Apr 2021 17:25:11 +0000 (18:25 +0100)] 
Refine README.md and some related files. [skip ci]

Lose the README symlink, it was a bad idea of mine to add it in the
first place as it made the packaging problem space bigger, not smaller.

Remove two CI badges at the top of README.md. One badge was stale
anyway, and the other does not represent the current CI configuration,
which is bigger, changes frequently and fits the web-site much better.

Remove the reference to ITA, it has been down for quite a while, it
looks like it won't re-emerge this time.

Merge PLATFORMS into README.md.

4 years agoCirrus CI: Bump FreeBSD 13.0 up to the release.
Denis Ovsienko [Thu, 15 Apr 2021 22:22:03 +0000 (23:22 +0100)] 
Cirrus CI: Bump FreeBSD 13.0 up to the release.

4 years agoCI: Remove the unused .travis.yml. [skip ci]
Denis Ovsienko [Fri, 9 Apr 2021 22:08:43 +0000 (23:08 +0100)] 
CI: Remove the unused .travis.yml. [skip ci]

The service has been disabled for a while, s390x and AArch64 CI runs
elsewhere.

4 years agoMPTCP: Print 'Length' inside mptcp options
Michal Ruprich [Fri, 19 Mar 2021 13:39:23 +0000 (14:39 +0100)] 
MPTCP: Print 'Length' inside mptcp options

Current mptcp parser prints 'mptcp <Subtype>...' but RFC 8684 in Section
3. states that the format should be 'mptcp <Length> <Subtype>...'

4 years agoGeoNet: Add a ND_TCHECK_LEN() call
Francois-Xavier Le Bail [Wed, 31 Mar 2021 08:11:39 +0000 (10:11 +0200)] 
GeoNet: Add a ND_TCHECK_LEN() call

4 years agoForCES: Get rid of some type casts.
Denis Ovsienko [Mon, 29 Mar 2021 14:59:59 +0000 (15:59 +0100)] 
ForCES: Get rid of some type casts.

4 years agoForCES: Refine SPARSEDATA-TLV length check.
Denis Ovsienko [Mon, 29 Mar 2021 14:49:58 +0000 (15:49 +0100)] 
ForCES: Refine SPARSEDATA-TLV length check.

When ilv_valid() returns a non-zero in sdatailv_print(), the amount of
bytes declared remaining may be insufficient to contain a complete
header, let alone any data. Thus do not try to hex dump the data,
instead print an error message and be done with it.

This fixes an inconsistency discovered by Francois-Xavier.

4 years agoLose a few forward declarations in tcpdump.c.
Denis Ovsienko [Mon, 29 Mar 2021 10:23:21 +0000 (11:23 +0100)] 
Lose a few forward declarations in tcpdump.c.

Reinstate a few comments in print.c for consistency.

4 years agoSpell "indent" where it belongs.
Denis Ovsienko [Sun, 28 Mar 2021 12:44:35 +0000 (13:44 +0100)] 
Spell "indent" where it belongs.

4 years agoLose a few forward declarations in print.c.
Denis Ovsienko [Sun, 28 Mar 2021 12:22:48 +0000 (13:22 +0100)] 
Lose a few forward declarations in print.c.

4 years agoASCII/hex: Use nd_trunc_longjmp() in truncation cases
Francois-Xavier Le Bail [Sat, 27 Mar 2021 15:14:27 +0000 (16:14 +0100)] 
ASCII/hex: Use nd_trunc_longjmp() in truncation cases

In functions ascii_print(), hex_and_ascii_print_with_offset() and
hex_print_with_offset().
Therefore indirectly for the functions hex_and_ascii_print(), hex_print()
and ndo_default_print().

Even if hex_and_ascii_print(), hex_print() and ascii_print() are used in
print.c after the setjmp() block with the calls:

1) hex_and_ascii_print(ndo, "\n\t", sp, h->caplen);
2) hex_and_ascii_print(ndo, "\n\t", sp + hdrlen, h->caplen - hdrlen);
3) hex_print(ndo, "\n\t", sp, h->caplen);
4) hex_print(ndo, "\n\t", sp + hdrlen, h->caplen - hdrlen);
5) ascii_print(ndo, sp, h->caplen);
6) ascii_print(ndo, sp + hdrlen, h->caplen - hdrlen);

sp and h->caplen are unmodified, ndo->ndo_snapend was restored.

1), 3) and 5) the length to print is caplen => no truncation can occur.
2), 4) and 6) the length to print is (caplen - hdrlen) after a shift of
hdrlen => no truncation can occur.

Moreover:
Update the output of three tests accordingly.
Remove an useless comment.
Fix indentation.

4 years agoCoverity: Use an executable POSIX shell script.
Denis Ovsienko [Sun, 21 Mar 2021 13:33:36 +0000 (13:33 +0000)] 
Coverity: Use an executable POSIX shell script.

Address all shellcheck warnings.

4 years agoCI: Apply more cleanups. [skip appveyor]
Denis Ovsienko [Sun, 21 Mar 2021 12:18:35 +0000 (12:18 +0000)] 
CI: Apply more cleanups. [skip appveyor]

Lose travis-conditions in the Travis CI script. Simplify libpcap
cloning. Dissolve choose_libpcap() as it just packed two separate
single-use functions into one, also lose a temporary variable. Fixup
indentation.

4 years agoCI: Refine the build matrix scripts. [skip appveyor]
Denis Ovsienko [Sun, 21 Mar 2021 00:26:58 +0000 (00:26 +0000)] 
CI: Refine the build matrix scripts. [skip appveyor]

Reproduce the recent improvements made in tcpslice and libpcap.

4 years agoCI: Use libpcap.a on MATRIX_BUILD_LIBPCAP=yes. [skip appveyor]
Denis Ovsienko [Thu, 18 Mar 2021 02:14:37 +0000 (02:14 +0000)] 
CI: Use libpcap.a on MATRIX_BUILD_LIBPCAP=yes. [skip appveyor]

The only way to pass tests on OpenBSD is to link with the upstream
libpcap using ../libpcap/libpcap.a (hence not using CMake) because
-lpcap always results in linking with OpenBSD /usr/lib/libpcap.so
regardless of the libpcap.a and libpcap.so that build.sh installs under
/tmp/local/.

Work around by not cleaning in ../libpcap on MATRIX_BUILD_LIBPCAP=yes,
so Autoconf can pick the static library up. On MATRIX_BUILD_LIBPCAP=no
do the cleaning so it cannot.

4 years agoDon't try to run the DLT_RAW test on OpenBSD.
Denis Ovsienko [Wed, 17 Mar 2021 11:49:51 +0000 (11:49 +0000)] 
Don't try to run the DLT_RAW test on OpenBSD.

With this change tcpdump passes "make check" on OpenBSD 6.8 AMD64.

4 years agoFixup formatting in tests/*.tests.
Denis Ovsienko [Wed, 17 Mar 2021 11:29:18 +0000 (11:29 +0000)] 
Fixup formatting in tests/*.tests.

4 years agoSquelch compiler warnings on OpenBSD.
Denis Ovsienko [Wed, 17 Mar 2021 04:02:23 +0000 (04:02 +0000)] 
Squelch compiler warnings on OpenBSD.

With these changes tcpdump passes "CFLAGS=-Werror make" on OpenBSD 6.8
AMD64, so build.sh has one less reason to fail.

gcc (GCC) 4.2.1 20070719
(also from OpenBSD clang version 10.0.1 with different wording)

./addrtoname.c: In function 'etheraddr_string':
./addrtoname.c:605: warning: passing argument 2 of 'ether_ntohost'
discards qualifiers from pointer target type

./addrtoname.c: In function 'init_etherarray':
./addrtoname.c:980: warning: passing argument 2 of 'ether_ntohost'
discards qualifiers from pointer target type

./print.c: In function 'pretty_print_packet':
./print.c:389: warning: passing argument 2 of 'ts_print' from
incompatible pointer type

./bpf_dump.c:34: warning: no previous prototype for 'bpf_dump'

4 years agoCirrus CI: Relabel the tasks for consistency.
Denis Ovsienko [Wed, 17 Mar 2021 03:53:06 +0000 (03:53 +0000)] 
Cirrus CI: Relabel the tasks for consistency.

4 years agobuild.sh, build_matrix.sh: Use more the PREFIX variable
Francois-Xavier Le Bail [Sat, 13 Mar 2021 17:30:19 +0000 (18:30 +0100)] 
build.sh, build_matrix.sh: Use more the PREFIX variable

4 years agoUninstall the version stamped tcpdump
Francois-Xavier Le Bail [Sat, 13 Mar 2021 16:23:43 +0000 (17:23 +0100)] 
Uninstall the version stamped tcpdump

4 years agoFix "make clean" for out-of-tree autotools builds
Francois-Xavier Le Bail [Sat, 13 Mar 2021 15:58:10 +0000 (16:58 +0100)] 
Fix "make clean" for out-of-tree autotools builds

4 years ago.cirrus.yml: quote strings in only_if expression
Nikolay Edigaryev [Fri, 5 Mar 2021 18:46:23 +0000 (21:46 +0300)] 
.cirrus.yml: quote strings in only_if expression

4 years agoCI: Relax the branch filters back. [skip ci]
Denis Ovsienko [Thu, 4 Mar 2021 21:43:16 +0000 (21:43 +0000)] 
CI: Relax the branch filters back. [skip ci]

Address feedback from Francois-Xavier and do not limit everyday CI to
the branches that are known-good for running build_matrix.sh, only mind
to skip the coverity_scan branch. Although this arrangement is not what
an upstream repository should use, it keeps CI simple in fork
repositories that have arbitrarily named branches with a working
build_matrix.sh.

This should also restore pull requests CI if the strict filters had
affected it.

4 years agoAppVeyor: Specify the same branches as elsewhere. [skip ci]
Denis Ovsienko [Thu, 4 Mar 2021 00:11:59 +0000 (00:11 +0000)] 
AppVeyor: Specify the same branches as elsewhere. [skip ci]

4 years agoTravis CI: Clean up. [skip ci]
Denis Ovsienko [Wed, 3 Mar 2021 04:37:40 +0000 (04:37 +0000)] 
Travis CI: Clean up. [skip ci]

4 years agoCI: Switch Coverity Scan from Travis to Cirrus. [skip appveyor]
Denis Ovsienko [Wed, 3 Mar 2021 01:57:13 +0000 (01:57 +0000)] 
CI: Switch Coverity Scan from Travis to Cirrus. [skip appveyor]

4 years agoCoverity: Get HTTP status codes right. [skip ci]
Denis Ovsienko [Wed, 3 Mar 2021 01:35:35 +0000 (01:35 +0000)] 
Coverity: Get HTTP status codes right. [skip ci]

See tcpslice commit 9f4f0b9.

4 years agoVTP: Fix a warning
Francois-Xavier Le Bail [Sun, 28 Feb 2021 13:50:06 +0000 (14:50 +0100)] 
VTP: Fix a warning

The warning on AppVeyor (Visual Studio 2017) was:
print-vtp.c(122): warning C4028: formal parameter 3 different from
declaration

4 years agoTravis CI: Allow the ppc64le job to fail
Francois-Xavier Le Bail [Wed, 24 Feb 2021 17:56:02 +0000 (18:56 +0100)] 
Travis CI: Allow the ppc64le job to fail

4 years agoTCP: Add a comment
Francois-Xavier Le Bail [Tue, 16 Feb 2021 20:01:27 +0000 (21:01 +0100)] 
TCP: Add a comment

This is a follow-up to commit 568d18f6eafb8df0d2500652b1cad49618051349.

[skip ci]

4 years agoBFD: Refine the previous commit.
Denis Ovsienko [Tue, 16 Feb 2021 00:59:17 +0000 (00:59 +0000)] 
BFD: Refine the previous commit.

Spell acronyms as they appear in respective specifications, fix a
reference in a comment, add a change log entry and update some tests.

4 years agoBFD: add SBFD support (RFC7880 and RFC7881) 905/head
Bill Fenner [Fri, 5 Feb 2021 05:10:31 +0000 (21:10 -0800)] 
BFD: add SBFD support (RFC7880 and RFC7881)

Add support for SBFD on UDP port 7784.  SBFD is different
in that packets from the reflector will be sent with *source*
port 7784; in all other BFD mechanisms, it is only the
destination port that matters.  For SBFD print-udp.c has to
check both source and destination port.

4 years agoL2TP: Add a bounds check
Francois-Xavier Le Bail [Sun, 14 Feb 2021 10:35:40 +0000 (11:35 +0100)] 
L2TP: Add a bounds check

Check if the offset padding octets are in the packet buffer.

4 years agoTCP: Add a bounds check before decoding the payload
Francois-Xavier Le Bail [Fri, 12 Feb 2021 20:49:40 +0000 (21:49 +0100)] 
TCP: Add a bounds check before decoding the payload

At least the header data is required.

Moreover:
Update the output of a test accordingly.
Fix indentation.

4 years agoIP: Add a bounds check before calling ip_demux_print()
Francois-Xavier Le Bail [Fri, 12 Feb 2021 13:20:52 +0000 (14:20 +0100)] 
IP: Add a bounds check before calling ip_demux_print()

At least the header data is required.

Moreover:
Fix indentation.

4 years agoTCP: Update the snapend before decoding a MPTCP option
Francois-Xavier Le Bail [Thu, 11 Feb 2021 20:09:00 +0000 (21:09 +0100)] 
TCP: Update the snapend before decoding a MPTCP option

Update the snapend to the end of the option before calling mptcp_print().
Some options (MPTCP or others) may be present after a MPTCP option.
This prevents that, in mptcp_print(), the remaining length < the remaining
caplen.

4 years agoDHCPv6: Rework the update of the snapend for nested DHCPv6 packets
Francois-Xavier Le Bail [Thu, 11 Feb 2021 18:41:39 +0000 (19:41 +0100)] 
DHCPv6: Rework the update of the snapend for nested DHCPv6 packets

There is no need to use nd_push_snapend()/nd_pop_packet_info().

4 years agoDHCPv6: Update the snapend for nested DHCPv6 packets
Francois-Xavier Le Bail [Thu, 11 Feb 2021 16:46:02 +0000 (17:46 +0100)] 
DHCPv6: Update the snapend for nested DHCPv6 packets

Update the snapend to the end of the option before calling recursively
dhcp6_print() for the nested packet.
Other options may be present after the nested DHCPv6 packet.
This prevents that, in dhcp6_print(), for the nested DHCPv6 packet,
the remaining length < remaining caplen.

4 years agoRestore the possibility of building when remote is enabled in libpcap
Francois-Xavier Le Bail [Thu, 11 Feb 2021 08:25:29 +0000 (09:25 +0100)] 
Restore the possibility of building when remote is enabled in libpcap

This change allows to test the build with HAVE_PCAP_FINDALLDEVS_EX and
HAVE_PCAP_OPEN enabled.

Some ways to run theses tests:

MATRIX_BUILD_LIBPCAP=yes MATRIX_REMOTE=yes MATRIX_CMAKE=no MATRIX_CC=gcc \
MATRIX_CRYPTO=no MATRIX_SMB=no ./build_matrix.sh
(configure should display:
checking for pcap_open... yes
checking for pcap_findalldevs_ex... yes)

MATRIX_BUILD_LIBPCAP=yes MATRIX_REMOTE=yes MATRIX_CMAKE=yes MATRIX_CC=gcc \
MATRIX_CRYPTO=no MATRIX_SMB=no ./build_matrix.sh
(cmake should display:
Looking for pcap_open - found
Looking for pcap_findalldevs_ex - found)

Don't enable the builds with REMOTE=yes by default.

This partially reverts commit 3861a41bfa60b9a8bed2d5a11a2ba7a7b1bbed3d.
"Remove the REMOTE dimension from the nested matrix."

4 years agoCirrus CI: Try to speed FreeBSD 13.0 up. [skip appveyor] [skip travis]
Denis Ovsienko [Thu, 11 Feb 2021 00:53:59 +0000 (00:53 +0000)] 
Cirrus CI: Try to speed FreeBSD 13.0 up. [skip appveyor] [skip travis]

Whatever the underlying reason, freebsd-13-0-snap used to take a couple
times more time to make it through the build than the other two image
families. After switching to the full nested matrix this started to
cause task timeouts and rescheduling. Let's see if a different
distribution of resources can improve this. Update the Linux task
comment while at it.

4 years agoESP: Remove padding, padding length and next header from the buffer
Francois-Xavier Le Bail [Wed, 10 Feb 2021 19:48:18 +0000 (20:48 +0100)] 
ESP: Remove padding, padding length and next header from the buffer

Moreover:
Fix indentation.

4 years agoCirrus CI: Refine some resource allocation. [skip appveyor] [skip travis]
Denis Ovsienko [Wed, 10 Feb 2021 16:27:15 +0000 (16:27 +0000)] 
Cirrus CI: Refine some resource allocation. [skip appveyor] [skip travis]

For FreeBSD and Linux request less memory than the default 4 GB.

Cirrus build graph claims that both FreeBSD and Linux tasks never use
more than 2 CPUs. For FreeBSD request 2 CPUs instead of 4 to enable all
three permutations run in parallel. For Linux request 4 CPUs instead of
8 to enable two concurrent tasks and split the nested matrix into two to
take advantage of that.

For macOS move and expand the comment.

4 years agoCirrus CI: Run build_matrix.sh on FreeBSD. [skip appveyor] [skip travis]
Denis Ovsienko [Wed, 10 Feb 2021 15:34:22 +0000 (15:34 +0000)] 
Cirrus CI: Run build_matrix.sh on FreeBSD. [skip appveyor] [skip travis]

4 years agoRemove the REMOTE dimension from the nested matrix. [skip appveyor]
Denis Ovsienko [Wed, 10 Feb 2021 14:10:06 +0000 (14:10 +0000)] 
Remove the REMOTE dimension from the nested matrix. [skip appveyor]

Neither the build process nor the tests of tcpdump currently depend on
presence or absence of the libpcap remote feature, and there is already
the libpcap nested matrix to cover that dimension, thus in the tcpdump
nested matrix just leave this aspect of the local libpcap build
unspecified and reduce the total number of rounds from 48 to 32.

4 years agobuild_matrix.sh: Update the SETUP line and the 'Build libpcap' printings
Francois-Xavier Le Bail [Wed, 10 Feb 2021 13:48:56 +0000 (14:48 +0100)] 
build_matrix.sh: Update the SETUP line and the 'Build libpcap' printings

4 years agobuild_matrix.sh: Fix typoes
Francois-Xavier Le Bail [Wed, 10 Feb 2021 13:02:45 +0000 (14:02 +0100)] 
build_matrix.sh: Fix typoes

For harmonization s/=/:/ between some keywords and values.

4 years agoTravis CI: Use AMD64 Linux build only for Coverity build
Francois-Xavier Le Bail [Wed, 10 Feb 2021 10:24:55 +0000 (11:24 +0100)] 
Travis CI: Use AMD64 Linux build only for Coverity build

4 years agoCirrus CI: Start building AMD64 Linux. [skip appveyor] [skip travis]
Denis Ovsienko [Tue, 9 Feb 2021 19:06:58 +0000 (19:06 +0000)] 
Cirrus CI: Start building AMD64 Linux. [skip appveyor] [skip travis]

4 years agoCI: Move [AMD64] macOS from Travis to Cirrus. [skip appveyor]
Denis Ovsienko [Tue, 9 Feb 2021 16:23:53 +0000 (16:23 +0000)] 
CI: Move [AMD64] macOS from Travis to Cirrus. [skip appveyor]

This change restores macOS CI, it might also unblock the stuck Travis CI
builds, as was the case with tcpslice and libpcap earlier. Let's see.

Also refine the FreeBSD tasks a bit, but do not switch them to
build_matrix.sh yet, as that combination is currently broken.

4 years agoAdd the build_matrix.sh and build.sh scripts
Francois-Xavier Le Bail [Sun, 7 Feb 2021 10:22:24 +0000 (11:22 +0100)] 
Add the build_matrix.sh and build.sh scripts

Use them with Travis CI to build with less builders and save CI runtime.
This will currently run five builders: amd64, arm64, ppc64le, s390x and osx.

The build_matrix.sh script executes the matrix loops, exclude tests and
cleaning.
It conditionally builds libpcap running the build.sh script of libpcap.
It calls the build.sh script which runs one build with setup environment
variables: BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB
(default: BUILD_LIBPCAP=no, REMOTE=no, CC=gcc, CMAKE=no, CRYPTO=no, SMB=no).
The matrix can be configured with environment variables
MATRIX_BUILD_LIBPCAP, MATRIX_REMOTE, MATRIX_CC, MATRIX_CMAKE, MATRIX_CRYPTO
and MATRIX_SMB
(default: MATRIX_BUILD_LIBPCAP='no yes', MATRIX_REMOTE='no yes',
MATRIX_CC='gcc clang', MATRIX_CMAKE='no yes', MATRIX_CRYPTO='no yes',
MATRIX_SMB='no yes').

These scripts can easily be updated to run new tests (32 bits builds,
sanitizers, coverage, etc).

They can be used locally for build tests or used with other CI systems.

Run examples:
./build_matrix.sh
MATRIX_BUILD_LIBPCAP=yes ./build_matrix.sh
MATRIX_CC=clang ./build_matrix.sh
CC=clang ./build.sh
CMAKE=yes ./build.sh
CC=clang CMAKE=yes CRYPTO=yes ./build.sh

Moreover:
Remove the old workaround PATH=$PATH...
Update the install directory prefix to /tmp/local.
Use vim modeline in the two shell scripts.

4 years agoRemove GENSRC remnants from Makefile.in. [skip appveyor]
Denis Ovsienko [Sat, 6 Feb 2021 01:45:41 +0000 (01:45 +0000)] 
Remove GENSRC remnants from Makefile.in. [skip appveyor]

The variable does not exist since commit 4943adf.

4 years agoSMB: Disable the printer by default with CMake build
Francois-Xavier Le Bail [Fri, 5 Feb 2021 17:01:41 +0000 (18:01 +0100)] 
SMB: Disable the printer by default with CMake build

This is a follow-up to commit 192db0a116f5ee419fddbdadf5822a7a3179d6c3.

[skip ci]