tcpdump
7 months agobump version and update CHANGES tcpdump-4.99.1
Michael Richardson [Wed, 9 Jun 2021 19:24:12 +0000 (15:24 -0400)] 
bump version and update CHANGES

7 months 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

(cherry picked from commit f91ef58f2f904e6e7bcbef7d184479cb89c6d360)

7 months 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

(cherry picked from commit 7eb602af5925c85bee9239a59196108d3cfaf7e7)

7 months 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.

(cherry picked from commit c39eb094791a3553b2a77e03ded78f50bc3ac4d2)

7 months 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.

(cherry picked from commit c7e9212a017ba0bea0abfd7d4b471c0082de8864)

7 months 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]

(cherry picked from commit 657d672cb672b80d4cd7a18a6f746968d9d44807)

7 months 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]

(cherry picked from commit 815919247bf40f65777cae4b4eb95f78b4e28917)

7 months 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]

(cherry picked from commit 5abf27529db8ad8bcadc31ebe5eadc4de036c898)

7 months 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.

(cherry picked from commit 4356f99512f7a4fd6ff8780b1e75aa102aaf3402)

7 months 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

(cherry picked from commit f9f128373b34d4448471c9c8bc7e1bea1e919ca5)

7 months 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

(cherry picked from commit 16c95291bde1c04a6e3c31da3b12c3b592d09968)

7 months 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]

(cherry picked from commit a5837ddd83efb74c0a423f091ec8ca2cfa8851e5)

7 months 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.

(cherry picked from commit e3a00d340c8707b178b0cce017e009cfaafdd22d)

7 months agoRefine Markdown in README.md. [skip appveyor]
Denis Ovsienko [Fri, 5 Feb 2021 14:25:11 +0000 (14:25 +0000)] 
Refine Markdown in README.md. [skip appveyor]

Move "by TTG" to the main header and eliminate a few duplicate "by"
sentences. Update a CI badge to use the travis-ci.com URLs. Make the
security note bold to help more people actually get it. Change the git
URL to github.com to be consistent with libpcap. Add and refine a few
headers. Add and improve hyperlink formatting in a few places. Lose a
few excess generic sentences. Fixup some minor editorial issues. Fence
the "from LBL" boilerplate, move it to the bottom of the dedicated
section and eliminate a few duplicate "from" sentences.

Skip only some CI on this occasion, so Travis CI can transfer the build
history from travis-ci.org to travus-ci.com and complete the migration.

(cherry picked from commit 50c0ec867c9fb34707060a3048a5dd2ae398da6a)

7 months agoICMP: Fix a typo in a comment.
Denis Ovsienko [Thu, 7 Jan 2021 01:07:46 +0000 (01:07 +0000)] 
ICMP: Fix a typo in a comment.

(cherry picked from commit c518a9aab149da1a6b83c0cbeddaff5265d05dcb)

7 months agoRemove the no more used nd_print() function
Francois-Xavier Le Bail [Sat, 9 Jan 2021 13:07:53 +0000 (14:07 +0100)] 
Remove the no more used nd_print() function

The function to use now is: nd_printjnp().
(Added by commit 635e3cc92b72ca048a6b5b89b883980e4e1b4bdc)

(cherry picked from commit f867bc9f40b4ce00e08fa6377bbb7d74719b9313)

7 months 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().

(cherry picked from commit 29973d83e8cecbb3bc940af216f6bef2376f39c5)

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

[skip ci]

(cherry picked from commit 59d322719785f4bc2a00bc4c2a35f93efc82f189)

7 months 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.

(cherry picked from commit f8491f77ac4d22b32cdf9d89540112c2bb037ffb)

7 months 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]

(cherry picked from commit c0335764f437b631c645e00e4e3c7be075bbb4e2)

7 months 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.

(cherry picked from commit df2dc59f6c0bf217afdbddbd178d3114a9edc2b5)

7 months 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]

(cherry picked from commit bf8bf8de486e8aa5771bccc0753b56d91df8f3d0)

7 months 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.

(cherry picked from commit 51bc4bffb849bd323fcff9a03b8b5492885fe37a)

7 months 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.

(cherry picked from commit ec3195c37396c003d4ed90c057fd88ba8cc81905)

7 months 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.

(cherry picked from commit e72a7ba0a21f1c1a0fc8472542bffa69abbf44b9)

7 months 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'.

(cherry picked from commit cf6c3fb2ad11e3ce94401b4371d91def79934310)

8 months 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.

(cherry picked from commit d76dc9f90ab9c6188063696668b6f2e749df7911)

8 months 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.

(cherry picked from commit 346ea98e51a8d50acbbe010f4b39b098d34caa2f)

8 months 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.

(cherry picked from commit 6f245276a2a24d673f2919e33476191781e20499)

8 months 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]

(cherry picked from commit eac90e30d2d35d12f8b3305dce86e2afb313c99f)

8 months 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.

(cherry picked from commit 7b7b84716e604abd8bd92cee75e6385cab6ce3dc)

8 months agoReplace ND_TCHECK_/memcpy() pairs with GET_CPY_BYTES().
Guy Harris [Wed, 6 Jan 2021 02:01:26 +0000 (18:01 -0800)] 
Replace ND_TCHECK_/memcpy() pairs with GET_CPY_BYTES().

For BGP, this eliminates some cases where routines return -1 on
truncation; clean up after that.

This also means that some memcpy()s get replaced by UNALIGNED_MEMCPY(),
which may fix some issues on processors that don't support unaligned
accesses.

(cherry picked from commit f853e73acf39658125ce42861e49ce4a181611d3)

9 months 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.

(cherry picked from commit cfa6c249d2224e4cc9277241b11c42931caea431)

9 months 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.

(cherry picked from commit 7714a5310b08f28a5373f20132944bed0a34e9a2)

9 months 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.

(cherry picked and updated from commit
 5d000b07738ee13d347d721d2492f739b212fdf5)

9 months 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.

(cherry picked from commit 1fb5643f91a91fe00428a6a0a0c256ba0fd2ad59)

9 months 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.

(cherry picked and updated from commit
 4fe72511c308b9b6a2cc094f88b40b2d0b8d8bab)

9 months agoCMake: add stuff from CMAKE_PREFIX_PATH to PKG_CONFIG_PATH.
Guy Harris [Fri, 8 Jan 2021 09:35:31 +0000 (01:35 -0800)] 
CMake: add stuff from CMAKE_PREFIX_PATH to PKG_CONFIG_PATH.

Pull in some code from CMake 3.12.4's FindPkgConfig.cmake to arrange
that, when running pkg-config, directories from CMAKE_PREFIX_PATH are in
the PKG_CONFIG_PATH environment variable.

We do this because we want to make sure that, if CMAKE_PREFIX_PATH is
set, and it points to a directory that contains a libpcap that has a .pc
file installed, we get that .pc file, but we don't yet want to require a
minimum of CMake 3.1 or later (CMake 3.1 and later do that
automatically) because there might be some long-term support OS version
that comes with an older version of CMake.

(cherry picked from commit 8ceef287ad9e3157c9ab390a102433e9203c2d90)

9 months 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

(cherry picked from commit 96029fecc241936806276832d9f8c9f83890e502)

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

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

(cherry picked from commit 0f19351efd103bf3bae5d005fadab4b6843055a4)

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

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'

(cherry picked from commit 7e29aa36055cb09e68325e3e26aeb82ef8584a89)

9 months 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.

(cherry picked from commit 5ee4e508deb94d0a8a0268cd72fd66dcfc680eb5)

9 months 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.

(cherry picked from commit 8281c4ae6e7e01524d20dd69b2275d0ed7949216)

9 months 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.

(cherry picked from commit c30c64d0cc2aea0f155060505a607dfcf1300083)

9 months 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.

(cherry picked from commit 75e92bef0055f2c44eb19e0545b3f6501d0bd316)

9 months 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.

(cherry picked from commit 40733327128628b8b0db270c4220beaaad1d6e02)

9 months 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.

(cherry picked from commit 8657e34a600f3b5fe0e0368ad06a0c7b1a18307b)

9 months agoman: Update a reference as www.cifs.org is gone. [skip ci]
Denis Ovsienko [Thu, 28 Jan 2021 23:29:57 +0000 (23:29 +0000)] 
man: Update a reference as cifs.org is gone. [skip ci]

(cherry picked from commit 76e6b9c658b25060e168aa72c4224824b63c97ac)

10 months 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

(cherry picked from commit fb8908c0ec90c025ea44fd298e9de2c96a7d859b)

10 months 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

(cherry picked from commit 9389efe24be9bfbc4bcaeaaace605494e5d9394b)

10 months 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

(cherry picked from commit 1239ef3d07d5d7748ccd3fae17820fdf105f1f9d)

10 months 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.

(cherry picked from commit ca3470f44e211cb0843b5aee2479f28f0dfa5a02)

10 months 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

(cherry picked from commit 534916a46d41a38536ecd50830321e374169a7a4)

10 months 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.

(cherry picked from commit 4cff6de3de5010d5df2afcd61e9bd0c0b10b40ca)

10 months 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]

(cherry picked from commit b6a63d4d14762268f5be7d34e508ed6696738655)

10 months 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]

(cherry picked from commit 96f16ee45b4eeb9f912a1ecced58b3f27373d6cf)

10 months 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]

(cherry picked from commit 72d146cb2167d59d59b07a5b0dfbc40e7ea5f245)

10 months 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.

(cherry picked from commit d6906a2fd22d271e0ce6a313bd8f9a7f027645ba)

10 months 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

(cherry picked from commit 8d55c5932ee1cd000a7e551ec23b3c21482347f9)

10 months 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.

(cherry picked from commit 57577610721997e4721c0d02b7860ef31cc399ba)

10 months 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.

(cherry picked from commits 568d18f6eafb8df0d2500652b1cad49618051349
 and 4df96273c0761d1b8426d9d867446e54a720a5a7)

10 months agoOpenFlow 1.0: Get snapend right for nested frames.
Denis Ovsienko [Fri, 22 Jan 2021 12:51:15 +0000 (12:51 +0000)] 
OpenFlow 1.0: Get snapend right for nested frames.

The current and the nested packets can and do have different snapend,
implement and comment that in of10_packet_data_print() to fix an issue
discovered by Francois-Xavier Le Bail.

(cherry picked from commits f39bd6851f0e4150377ce8a1f0136b8aad821ce8
 and 6c982c49c695e958f6e881874b7ba1cc447588a0)

10 months 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.

(cherry picked from commits 3076dc3166d1d854a965443451ff3915d054d8f1
 and 31cc0605021eec33924ff7a8e310fa372bed3d3c)

10 months 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.

(cherry picked from commit c4c8ea9a2c9f0769034e6c4d418508308032e6e8)

10 months agoMSDP: Print ": " before the protocol name
Francois-Xavier Le Bail [Mon, 1 Feb 2021 09:31:34 +0000 (10:31 +0100)] 
MSDP: Print ": " before the protocol name

Like with most TCP encapsulated protocols.
Use nd_print_protocol().
No more ":" after protocol name.
This change will print the protocol name even in truncation cases.

(cherry picked from commit 74a4e7404c282b61ab5b051250822af45bfbb388)

10 months agoMACsec: Update the snapend thus the ICV field is not payload for the caller
Francois-Xavier Le Bail [Mon, 25 Jan 2021 17:05:59 +0000 (18:05 +0100)] 
MACsec: Update the snapend thus the ICV field is not payload for the caller

The ICV (Integrity Check Value) is at the end of the frame, after the
secure data.

(cherry picked from commits ff01ae8e5126f4d30eb582add8d64dbe2228cc5f
 and 490e000ac19326bd5119e7285a502c4b269b603c)

10 months 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

(cherry picked from commit d860c9d14138858dec03f8c4ab449e7476b95736)

10 months agoICMP: Update the snapend for some nested IP packets
Francois-Xavier Le Bail [Sun, 24 Jan 2021 09:52:50 +0000 (10:52 +0100)] 
ICMP: Update the snapend for some nested IP packets

Update the snapend because extensions (MPLS, ...) may be present
after the IP packet. In this case the current (outer) packet's
snapend is not what ip_print() needs to decode an IP packet nested
in the middle of an ICMP payload.

This prevents that, in ip_print(), for the nested IP packet, the
remaining length < remaining caplen.

Moreover:
Reduce the scope of a variable.
Fix spaces

(cherry picked and updated from commit
 a29cd3e75e78bab784e906d6a4978d05510613c8)

10 months agoOLSR: Print the protocol name even if the packet is invalid
Francois-Xavier Le Bail [Fri, 15 Jan 2021 13:16:18 +0000 (14:16 +0100)] 
OLSR: Print the protocol name even if the packet is invalid

(cherry picked from commit b0910795a986a3bf5481f978337b0a78e160c144)

10 months agoTESTrun: Show tcpdump version used for tests
Francois-Xavier Le Bail [Wed, 6 Jan 2021 13:23:08 +0000 (14:23 +0100)] 
TESTrun: Show tcpdump version used for tests

(cherry picked from commit 93cb1f2257ae3671b6750647273d1d359e6075dd)

10 months agoRemove '-t' option for MACsec tests
Francois-Xavier Le Bail [Tue, 5 Jan 2021 14:18:17 +0000 (15:18 +0100)] 
Remove '-t' option for MACsec tests

like all the other tests.

(cherry picked from commit dd5c8e67761d96727d45d72daf3b2f2f93bd075c)

10 months agoCirrus CI: Use build_matrix.sh on AMD64 Linux, FreeBSD and macOS
Francois-Xavier Le Bail [Tue, 23 Feb 2021 21:03:01 +0000 (22:03 +0100)] 
Cirrus CI: Use build_matrix.sh on AMD64 Linux, FreeBSD and macOS

(Apply the same updates than in master branch, it's the result of
several commits.)

[skip ci]

10 months agoAdd the build_matrix.sh and build.sh scripts
Francois-Xavier Le Bail [Tue, 23 Feb 2021 20:15:21 +0000 (21:15 +0100)] 
Add the build_matrix.sh and build.sh scripts

(Apply the same updates than in master branch, it's the result of
several commits.)

Use them with Travis CI to build with less builders and save CI runtime.
This will currently run three Linux builders: arm64, ppc64le and s390x.
amd64 Linux build will be only used for Coverity build.

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.

11 months 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]

(cherry picked from commit 5cae5a274c59d95ffad39b3930fe19af78c18830)

11 months agoEIGRP: Get the packet header fields right.
Denis Ovsienko [Sat, 9 Jan 2021 22:04:28 +0000 (22:04 +0000)] 
EIGRP: Get the packet header fields right.

In the spec the packet diagram instead of a 32-bit AS number shows a
16-bit virtual router ID followed by a 16-bit AS number, implement
that. Also add two missing flag values and use bittok2str() to print
the bitmask. Lose a stale comment and update some tests.

(cherry picked from commit 7d7fea337bbce1ec079baa786f8d9f88d960c2c1)

12 months agoTravis CI: Use Linux Focal (Ubuntu 20.04)
Francois-Xavier Le Bail [Fri, 1 Jan 2021 09:43:23 +0000 (10:43 +0100)] 
Travis CI: Use Linux Focal (Ubuntu 20.04)

gcc 9.3.0 (on Bionic was 7.5.0)

(cherry picked from commit b0d1c27b08e84ebf46a78fcdab1e7fbb4ff73127)

12 months agoRegenerate configure with the updated VERSION.
Guy Harris [Mon, 4 Jan 2021 07:13:37 +0000 (23:13 -0800)] 
Regenerate configure with the updated VERSION.

12 months agoUpdate version.
Guy Harris [Mon, 4 Jan 2021 03:18:32 +0000 (19:18 -0800)] 
Update version.

That way, builds from this tree won't show up as being 4.99.0 builds.

12 months agoUpdate CHANGES to reflect backported changes from trunk.
Guy Harris [Mon, 4 Jan 2021 03:05:45 +0000 (19:05 -0800)] 
Update CHANGES to reflect backported changes from trunk.

12 months agoFix a warning on Linux Alpine
Francois-Xavier Le Bail [Sat, 2 Jan 2021 13:03:00 +0000 (14:03 +0100)] 
Fix a warning on Linux Alpine

The warning was like:
In file included from ./netdissect-stdinc.h:42,
                 from ./fptype.c:36:
./ftmacros.h:116: warning: "_BSD_SOURCE" redefined
  116 |   #define _BSD_SOURCE
      |
In file included from /usr/include/stdio.h:8,
                 from /usr/include/fortify/stdio.h:22,
                 from ./fptype.c:34:
/usr/include/features.h:15: note: this is the location of the previous
  definition
   15 | #define _BSD_SOURCE 1
      |

(cherry picked from commit ac88cb08eb2ea344e0bb5524355caa9093ee89c4)

12 months agoTravis CI: Remove capture on architecture arm64 (not always working)
Francois-Xavier Le Bail [Sat, 2 Jan 2021 15:14:49 +0000 (16:14 +0100)] 
Travis CI: Remove capture on architecture arm64 (not always working)

(cherry picked from commit 88d49d2b0617b6d7c79e9df1de18b3f9a50ae3c4)

12 months agoMakefile.in: Run 'autoreconf -f' when buiding release
Francois-Xavier Le Bail [Thu, 31 Dec 2020 10:42:06 +0000 (11:42 +0100)] 
Makefile.in: Run 'autoreconf -f' when buiding release

Same as for libpcap.

It's needed to update configure (PACKAGE_VERSION, PACKAGE_STRING, etc.)
when VERSION is updated.

(cherry picked from commit b1e86c1f0346baa24a8c72ce3bf8b4e3fcb5e36e)

12 months agoFix a build problem on the Linux Travis CI buildbot.
Guy Harris [Sat, 2 Jan 2021 09:06:36 +0000 (01:06 -0800)] 
Fix a build problem on the Linux Travis CI buildbot.

The buildbot is failing in autotools builds - but not in CMake builds;
go figure.  Perhaps they're passing different flags to the C compiler,
and, in the autotools builds, the flag causes the compiler to define
whatever it takes to get /usr/include/features.h to define
_DEFAULT_SOURCE as 1, so that our defining it as nothing collides with
that.

(Dear UN*X community: please come up with a platform-independent,
reliable way of saying "expose every single API you have, namespace
pollution be damned.  kthxbye.)

(cherry picked from commit a689cf870986a04cf7a8b4fc74cab10e808f3c93)

12 months agoAdd ftmacros.h, defining various feature test macros, and use it.
Guy Harris [Sat, 2 Jan 2021 06:47:27 +0000 (22:47 -0800)] 
Add ftmacros.h, defining various feature test macros, and use it.

This attempts to ensure that we get all the APIs for the platform
declared, including the ones that, shock horror, "pollute the
namespace".

This fixes some compile failures with Sun C on Solaris 11.

(cherry picked from commit eebc98d735bc573c297578674efc470e7fd29998)

12 months agoSquelch some signed vs. unsigned warnings.
Guy Harris [Sat, 2 Jan 2021 05:08:32 +0000 (21:08 -0800)] 
Squelch some signed vs. unsigned warnings.

They showed up on 64-bit OpenBSD 6.6.

(cherry picked from commit 399c5ebdd0432e413ab146bd65ae01f565db1edc)

12 months agofixed date in CHANGES file
Michael Richardson [Thu, 31 Dec 2020 23:26:06 +0000 (18:26 -0500)] 
fixed date in CHANGES file

12 months agoupdated VERSION in configure tcpdump-4.99.0
Michael Richardson [Wed, 30 Dec 2020 19:20:00 +0000 (14:20 -0500)] 
updated VERSION in configure

12 months agoset version to 4.99
Michael Richardson [Tue, 29 Dec 2020 21:42:48 +0000 (16:42 -0500)] 
set version to 4.99

12 months agoUpdate my email address. tcpdump-4.99-bp tcpdump-4.99.0-bp
Guy Harris [Tue, 29 Dec 2020 19:59:47 +0000 (11:59 -0800)] 
Update my email address.

[skip ci]

12 months agoList more contributors in CREDITS. [ckip ci]
Denis Ovsienko [Mon, 28 Dec 2020 15:45:51 +0000 (15:45 +0000)] 
List more contributors in CREDITS. [ckip ci]

Add new people that had authored at least one commit in 2013-2020, that
is, in the 1dcb552..4b5b833 git revision range.

12 months agoFixup existing records in CREDITS. [skip ci]
Denis Ovsienko [Mon, 28 Dec 2020 14:29:54 +0000 (14:29 +0000)] 
Fixup existing records in CREDITS. [skip ci]

12 months agoFill the 4.99.0 section in CHANGES. [skip ci]
Denis Ovsienko [Mon, 28 Dec 2020 06:23:30 +0000 (06:23 +0000)] 
Fill the 4.99.0 section in CHANGES. [skip ci]

12 months agoAdd a missing space to doc/README.Win32.md. [skip ci]
Denis Ovsienko [Mon, 28 Dec 2020 04:21:46 +0000 (04:21 +0000)] 
Add a missing space to doc/README.Win32.md. [skip ci]

12 months agoLose a leftover comment [skip ci]
Denis Ovsienko [Sun, 27 Dec 2020 22:23:23 +0000 (22:23 +0000)] 
Lose a leftover comment [skip ci]

12 months agoUpdate VERSION to 4.99.0-PRE-GIT; Run 'autoreconf -f'
Francois-Xavier Le Bail [Sun, 27 Dec 2020 09:57:40 +0000 (10:57 +0100)] 
Update VERSION to 4.99.0-PRE-GIT; Run 'autoreconf -f'

Reminder:
Run 'autoreconf -f' is needed to update configure when VERSION is updated.

12 months agoLose the HTON and NTOH macros. [skip ci]
Denis Ovsienko [Sat, 26 Dec 2020 00:28:02 +0000 (00:28 +0000)] 
Lose the HTON and NTOH macros. [skip ci]

Out of the four macros two were never used, and the other two were used
only once. Use htonl() and htons() directly instead.

12 months agoCFM: Fix another typo in a comment. [skip ci]
Denis Ovsienko [Fri, 25 Dec 2020 23:43:09 +0000 (23:43 +0000)] 
CFM: Fix another typo in a comment. [skip ci]

12 months agoList Linux properly and only once. [skip ci]
Denis Ovsienko [Fri, 25 Dec 2020 23:16:52 +0000 (23:16 +0000)] 
List Linux properly and only once. [skip ci]

Whatever libc it is, the usual rules apply: if it does not work, report
the bug.

12 months agoUpdate config.{guess,sub}, timestamps 2020-12-22
Francois-Xavier Le Bail [Wed, 23 Dec 2020 15:43:48 +0000 (16:43 +0100)] 
Update config.{guess,sub}, timestamps 2020-12-22

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

12 months agoRefine some guidelines in CONTRIBUTING [skip ci]
Denis Ovsienko [Tue, 22 Dec 2020 02:37:41 +0000 (02:37 +0000)] 
Refine some guidelines in CONTRIBUTING [skip ci]

Improve some language, spell both build systems and all three CI
systems, deduplicate some text, drop ND_TTEST_*(), introduce GET_*()
and explain the bounds checks in a bit more detail.