]> The Tcpdump Group git mirrors - tcpdump/log
tcpdump
4 years agoTCP: Add a test with data in the RST segment
Francois-Xavier Le Bail [Mon, 18 Jan 2021 11:46:23 +0000 (12:46 +0100)] 
TCP: Add a test with data in the RST segment

4 years agoTry the new ND_LCHECK*() macros. [skip ci]
Denis Ovsienko [Sun, 17 Jan 2021 23:11:19 +0000 (23:11 +0000)] 
Try the new ND_LCHECK*() macros. [skip ci]

4 years agoTCP: Modernize packet parsing style.
Denis Ovsienko [Sun, 17 Jan 2021 21:22:34 +0000 (21:22 +0000)] 
TCP: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Report invalid packets as invalid. Remove
most ND_TCHECK*() instances as they were redundant. Update a custom
snapend guard to use nd_trunc_longjmp(). Reduce arity of
print_tcp_fastopen_option(). Use ND_TTEST_LEN() in
tcp_verify_signature() and nd_printn() in print_tcp_rst_data(). For
NFS_PORT remove ND_TTEST_4() from the test condition as it is not a
valid factor, there is the subsequent GET_BE_U_4() to check bounds.

4 years agoMPTCP: Put GET_U_1() outside of macros.
Denis Ovsienko [Sat, 16 Jan 2021 23:39:01 +0000 (23:39 +0000)] 
MPTCP: Put GET_U_1() outside of macros.

This way it is much easier to proof-read the bounds checks coverage
even without the comments. Fixup some whitespace while at it.

4 years agoNetFlow: Use tcp_flag_values[] for TCP flags.
Denis Ovsienko [Sat, 16 Jan 2021 10:56:30 +0000 (10:56 +0000)] 
NetFlow: Use tcp_flag_values[] for TCP flags.

This way there is less code duplication and more consistency.

4 years agoOLSR: Fix a goto before ND_PRINT
Francois-Xavier Le Bail [Sun, 17 Jan 2021 10:30:26 +0000 (11:30 +0100)] 
OLSR: Fix a goto before ND_PRINT

4 years agoFix a typo in ND_LCHECK_ZU definition
Francois-Xavier Le Bail [Sun, 17 Jan 2021 09:29:12 +0000 (10:29 +0100)] 
Fix a typo in ND_LCHECK_ZU definition

[skip ci]

4 years agoAdd ND_LCHECKMSG_U, ND_LCHECK_U, ND_LCHECKMSG_ZU and ND_LCHECK_ZU macros
Francois-Xavier Le Bail [Sat, 16 Jan 2021 13:27:21 +0000 (14:27 +0100)] 
Add ND_LCHECKMSG_U, ND_LCHECK_U, ND_LCHECKMSG_ZU and ND_LCHECK_ZU macros

They check length < minimum for invalid packet with or without a custom
message, format %u or %zu.

%zu (ND_LCHECKMSG_ZU and ND_LCHECK_ZU) is useful when minimum is a
sizeof(...).

[skip ci]

4 years agoDCCP: Replace some magic numbers
Francois-Xavier Le Bail [Sat, 16 Jan 2021 10:54:03 +0000 (11:54 +0100)] 
DCCP: Replace some magic numbers

4 years agoAODV: Modernize packet parsing style.
Denis Ovsienko [Fri, 15 Jan 2021 22:30:40 +0000 (22:30 +0000)] 
AODV: Modernize packet parsing style.

Make all ND_TCHECK_SIZE() instances redundant and remove them. Always
print a reason when reporting a packet as invalid. Undo the changes from
commit f875106 to remove support for draft-perkins-aodv6-01, which had
expired in 2001. Use tok2str() to print the message type. Don't print an
additional "v6" for RREQ, as the address family is apparent from the UDP
header. Update a test.

4 years 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

4 years agoRIP: Modernize packet parsing style.
Denis Ovsienko [Thu, 14 Jan 2021 03:48:28 +0000 (03:48 +0000)] 
RIP: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Report invalid packets as invalid. Remove
two redundant ND_TCHECK_SIZE() instances and an improvised snapshot end
guard. Check bounds for the remaining part of the packet header after
printing version and command, not before. Lose one pointer and one
length variable in rip_print(), also account for the header size when
estimating the number of routes. Update two tests.

4 years agoRIP: Make a couple trivial protocol updates.
Denis Ovsienko [Thu, 14 Jan 2021 03:31:50 +0000 (03:31 +0000)] 
RIP: Make a couple trivial protocol updates.

Synchronize with the RIP Commands IANA registry and treat version 0 as
invalid.

4 years agoOpenFlow 1.0: Fix indentation of PORT_MOD.
Denis Ovsienko [Wed, 13 Jan 2021 15:42:01 +0000 (15:42 +0000)] 
OpenFlow 1.0: Fix indentation of PORT_MOD.

Also lose an unused constant while at it.

4 years agoRefine print_unknown_data().
Denis Ovsienko [Wed, 13 Jan 2021 15:21:25 +0000 (15:21 +0000)] 
Refine print_unknown_data().

Use __func__ and ND_MIN() for simplicity.

4 years agoAppleTalk: Modernize packet parsing style.
Denis Ovsienko [Wed, 13 Jan 2021 00:43:49 +0000 (00:43 +0000)] 
AppleTalk: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Report invalid packets as invalid. Remove
all improvised snapshot end guards as they were redundant. In
print_cstring() have nd_printjn() guard the snapshot end. Use tok2str()
in nbp_print(). Update two tests.

4 years agoAppleTalk: Declutter appletalk.h.
Denis Ovsienko [Tue, 12 Jan 2021 18:13:26 +0000 (18:13 +0000)] 
AppleTalk: Declutter appletalk.h.

Lose unused definitions and structures. Move most other contents into
print-atalk.c and rearrange for clarity. Lose a dead #ifdef block.

4 years agoUDP: Modernize packet parsing style.
Denis Ovsienko [Tue, 12 Jan 2021 15:52:23 +0000 (15:52 +0000)] 
UDP: Modernize packet parsing style.

Remove all ND_TCHECK_*() instances as redundant. Remove or convert a few
improvised snapshot end guards. Reduce arity of rtcp_print(). Test the
AppleTalk LAP type after testing the UDP port numbers, not before.

4 years agoUDP: Clean up address and port printing.
Denis Ovsienko [Tue, 12 Jan 2021 13:37:50 +0000 (13:37 +0000)] 
UDP: Clean up address and port printing.

udp_print() always knows whether UDP port numbers are available or not,
so split udpipaddr_print() into two functions to lose some arity, much
branching and all type casting. In the new functions test for IPv4
explicitly. In udp_print() convert duplicate code into a conditional
call to udpipaddr_print().

4 years agoEGP: Modernize packet parsing style.
Denis Ovsienko [Mon, 11 Jan 2021 14:47:59 +0000 (14:47 +0000)] 
EGP: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Report invalid packets as invalid.

4 years agoMention the recent EIGRP changes.
Denis Ovsienko [Mon, 11 Jan 2021 14:38:29 +0000 (14:38 +0000)] 
Mention the recent EIGRP changes.

4 years agoSLIP: Remove 4 ND_TCHECK_SIZE() calls
Francois-Xavier Le Bail [Thu, 1 Oct 2020 20:07:58 +0000 (22:07 +0200)] 
SLIP: Remove 4 ND_TCHECK_SIZE() calls

IP_HL() and TH_OFF() macros use GET_U_1().

4 years agotravis_terminate *causes* the problem on macOS; use it only on Linux.
Guy Harris [Sun, 10 Jan 2021 02:06:50 +0000 (18:06 -0800)] 
travis_terminate *causes* the problem on macOS; use it only on Linux.

More fun in the new world.

4 years agoEIGRP: Modernize packet parsing style.
Denis Ovsienko [Sun, 10 Jan 2021 00:53:43 +0000 (00:53 +0000)] 
EIGRP: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Report invalid packets as invalid. Remove
two redundant ND_TCHECK_*() instances. When giving up on a packet for
whatever reason, test that the rest of it is within the buffer. Do the
header length check before accessing any header data and refine the TLV
length checks. Update a test.

4 years 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.

4 years agoTravis CI: Fix a typo in a comment
Francois-Xavier Le Bail [Sat, 9 Jan 2021 18:32:57 +0000 (19:32 +0100)] 
Travis CI: Fix a typo in a comment

[skip ci]

4 years 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)

4 years agoTravis: use travis_terminate instead of exit in script:.
Guy Harris [Sat, 9 Jan 2021 05:23:58 +0000 (21:23 -0800)] 
Travis: use travis_terminate instead of exit in script:.

That was the Travis maintainer's recommendation to fix the hang we were
seeing on non-x86-64 Linux coverity_scan builds.

4 years agoRemove debugging printouts.
Guy Harris [Fri, 8 Jan 2021 20:23:04 +0000 (12:23 -0800)] 
Remove debugging printouts.

The problem appears to be with the

if [ "$COVERITY_SCAN_BRANCH" = 1 ]; then exit 0; fi

line in the script: section of .travis.yml; libpcap has the line

if [ "$COVERITY_SCAN_BRANCH" = 1 ]; then echo "Coverity build - nothing more to do"; exit 0; fi

and also fails, so exiting without a message isn't the problem, and when
I tried adding

if [ "$COVERITY_SCAN_BRANCH" = 0 ]; then echo "Non-Coverity build - pstill nothing more to do"; exit 0; fi

and the ppc64le Linux builds were failing with a timeout rather than
just doing nothing - the AMD64 Linux didn't have a problem, so there's
something different about the non-x86-64 builds that's causing the "exit
0" stuff not to work.

4 years agoReplace the (void)nd_printn(..., NULL) calls by nd_printjn() calls
Francois-Xavier Le Bail [Fri, 8 Jan 2021 15:21:39 +0000 (16:21 +0100)] 
Replace the (void)nd_printn(..., NULL) calls by nd_printjn() calls

Moreover:
Remove a now useless comment.

4 years agoAdd a nd_printjn() function
Francois-Xavier Le Bail [Fri, 8 Jan 2021 15:09:41 +0000 (16:09 +0100)] 
Add a nd_printjn() function

It prints a counted filename (or other ASCII string), part of
the packet buffer, filtering out non-printable characters.
Stop if truncated (via GET_U_1/longjmp) or after n bytes,
whichever is first.
The suffix comes from: j:longJmp, n:after N bytes.

4 years agoTravis CI: Add a folded 'ldd tcpdump' (Linux builds)
Francois-Xavier Le Bail [Wed, 6 Jan 2021 15:41:09 +0000 (16:41 +0100)] 
Travis CI: Add a folded 'ldd tcpdump' (Linux builds)

4 years agoTravis CI: Add 'echo '$ cmake [...]' to the folded cmake
Francois-Xavier Le Bail [Wed, 6 Jan 2021 17:42:09 +0000 (18:42 +0100)] 
Travis CI: Add 'echo '$ cmake [...]' to the folded cmake

With this change the output can be unfolded.

4 years agoTravis/Coverity: put some debugging printouts into coverity-scan-build.
Guy Harris [Fri, 8 Jan 2021 10:10:23 +0000 (02:10 -0800)] 
Travis/Coverity: put some debugging printouts into coverity-scan-build.

4 years agoTravis: we should no longer need to set PKG_CONFIG_PATH for CMake.
Guy Harris [Fri, 8 Jan 2021 09:38:16 +0000 (01:38 -0800)] 
Travis: we should no longer need to set PKG_CONFIG_PATH for CMake.

FindPCAP.cmake should now pick up directories from CMAKE_PREFIX_PATH and
add the corresponding pkgconfig directories to PKG_CONFIG_PATH before
running pkg-config, so we shouldnt need to set PKG_CONFIG_PATH
ourselves.

We still need to do it when running the autoonf script, as there's no
equivalent for CMAKE_PREFIX_PATH in autoconf.

4 years 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.

4 years agoBOOTP: Modernize packet parsing style.
Denis Ovsienko [Fri, 8 Jan 2021 03:23:26 +0000 (03:23 +0000)] 
BOOTP: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Report invalid packets as invalid. Have
nd_printn() and nd_printztn() guard the snapshot end. Replace
client_fqdn_flags() with bittok2str_nosep().

4 years agoPoint the configure script at the installed pkg-config directory in /tmp.
Guy Harris [Thu, 7 Jan 2021 22:36:52 +0000 (14:36 -0800)] 
Point the configure script at the installed pkg-config directory in /tmp.

Getting the configure script to look for the temporarily-installed
libpcap.pc file requires that we set PKG_CONFIG_PATH to
/tmp/lib/pkgconfig.

4 years agoPoint cmake at the installed pkg-config directory in /tmp.
Guy Harris [Thu, 7 Jan 2021 20:45:12 +0000 (12:45 -0800)] 
Point cmake at the installed pkg-config directory in /tmp.

Getting CMake to look for the temporarily-installed libpcap.pc file
requires that we set PKG_CONFIG_PATH to /tmp/lib/pkgconfig; otherwise,
the configuration process won't find it, and hilarity ensues.

Try turning the 'BUILD_LIBPCAP=yes CMAKE=yes' builds on, to see if that
fixes them.

4 years agoDenis has made changes to the 5.0.0 entry in CHANGES as well.
Guy Harris [Thu, 7 Jan 2021 19:41:30 +0000 (11:41 -0800)] 
Denis has made changes to the 5.0.0 entry in CHANGES as well.

[skip ci]

4 years agoUpdate a comment.
Guy Harris [Thu, 7 Jan 2021 19:40:32 +0000 (11:40 -0800)] 
Update a comment.

Apple's released ARM-based Macs, so it's no longer just a possibility.
(Travis doesn't have any, so we don't add an arm64 build for macOS.)

[skip ci]

4 years 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.

4 years agoL2TP: Modernize packet parsing style.
Denis Ovsienko [Wed, 6 Jan 2021 22:45:14 +0000 (22:45 +0000)] 
L2TP: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Report invalid packets as invalid with a
reason, not truncated.

4 years 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

4 years agoMPLS: rename the "exp" field to "tc"
Bill Fenner [Fri, 11 Dec 2020 14:20:31 +0000 (06:20 -0800)] 
MPLS: rename the "exp" field to "tc"

RFC5462 (https://tools.ietf.org/html/rfc5462) renamed the
MPLS "EXP" field to "Traffic Class" in 2009.  Use "tc" as an
abbreviation for this field name.

4 years 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.

4 years agoGeneve: Modernize packet parsing style.
Denis Ovsienko [Wed, 6 Jan 2021 01:32:07 +0000 (01:32 +0000)] 
Geneve: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Remove one redundant ND_TCHECK_*()
instance and make another one conditional. Report invalid packets as
invalid. Test that a non-Ethernet payload is fully within the packet
buffer. Add a length check to geneve_opts_print() and have it indicate
invalid tunnel options. Constify an argument. Update the packet diagrams
and refer to the RFC rather than the draft.

4 years agoAdd tests for more code coverage in timestamp printing functions
Francois-Xavier Le Bail [Tue, 5 Jan 2021 16:03:32 +0000 (17:03 +0100)] 
Add tests for more code coverage in timestamp printing functions

Use a TCP 3-Way Handshake test, nano precision.

Display micro outputs and nano outputs (with -q).

4 years 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.

4 years agoAdd an entry for the trunk changes so far that are not in 4.99.
Guy Harris [Mon, 4 Jan 2021 03:17:31 +0000 (19:17 -0800)] 
Add an entry for the trunk changes so far that are not in 4.99.

4 years agoAdd an entry for the 4.99 branch changes so far.
Guy Harris [Mon, 4 Jan 2021 03:08:22 +0000 (19:08 -0800)] 
Add an entry for the 4.99 branch changes so far.

4 years 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
      |

4 years 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)

4 years 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.

4 years 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.)

4 years 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.

4 years agoUse %zu when printing a sizeof.
Guy Harris [Sat, 2 Jan 2021 06:12:44 +0000 (22:12 -0800)] 
Use %zu when printing a sizeof.

We require a C implementation that supports %z, so we can use it; there
is no guarantee that a sizeof is a long, so don't use %l.

Squelches warnings found on Solaris 11 with GCC.

4 years 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.

4 years agoOLSR: Modernize packet parsing style.
Denis Ovsienko [Sat, 2 Jan 2021 04:01:35 +0000 (04:01 +0000)] 
OLSR: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Remove a few redundant ND_TCHECK_*()
instances. Report invalid packets as invalid with a reason, not
truncated. Make helper functions void and lose associated checks.

4 years agoEGP: Replace custom code with tok2str().
Denis Ovsienko [Sat, 2 Jan 2021 03:08:03 +0000 (03:08 +0000)] 
EGP: Replace custom code with tok2str().

4 years agoPGM: Modernize packet parsing style.
Denis Ovsienko [Sat, 2 Jan 2021 02:09:43 +0000 (02:09 +0000)] 
PGM: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Remove a few redundant ND_TCHECK_*()
instances. Report invalid packets as invalid, not truncated. Update a
custom snapshot end guard to call nd_trunc_longjmp().

4 years agoRSVP: Modernize packet parsing style.
Denis Ovsienko [Fri, 1 Jan 2021 22:40:47 +0000 (22:40 +0000)] 
RSVP: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Remove a few redundant ND_TCHECK_*()
instances. Report invalid packets as invalid with a reason.

4 years 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)

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

4 years agobumped version on master
Michael Richardson [Thu, 31 Dec 2020 23:25:35 +0000 (18:25 -0500)] 
bumped version on master

4 years agoCHANGES: Add the date
Francois-Xavier Le Bail [Thu, 31 Dec 2020 09:59:49 +0000 (10:59 +0100)] 
CHANGES: Add the date

4 years agoRevert "added some references and missing CVE to CHANGES"
Francois-Xavier Le Bail [Wed, 30 Dec 2020 09:11:28 +0000 (10:11 +0100)] 
Revert "added some references and missing CVE to CHANGES"

This reverts commit 8a3252dfe59a944537826c73194e644c2d5fd62f.

The duplicate CVEs was removed by 23be4d12401b000874c3aa0a5104e54ba39a3d02.
The inexistant URL was removed by c29dbf9b4f1a6350aeff6be1dd75ae32c34a055d.

[skip ci]

4 years agoadded some references and missing CVE to CHANGES
Michael Richardson [Tue, 29 Dec 2020 21:50:23 +0000 (16:50 -0500)] 
added some references and missing CVE to CHANGES

4 years 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]

4 years 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.

4 years 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]

4 years 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]

4 years 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]

4 years 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]

4 years 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.

4 years 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.

4 years 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]

4 years 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.

4 years 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

4 years 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.

4 years agoCopy the 4.9.3 section and start 4.99.0 in CHANGES [skip ci]
Denis Ovsienko [Tue, 22 Dec 2020 00:08:50 +0000 (00:08 +0000)] 
Copy the 4.9.3 section and start 4.99.0 in CHANGES [skip ci]

4 years agoman: Note the -x/-X quirk for truncated packets [skip ci]
Denis Ovsienko [Mon, 21 Dec 2020 02:46:37 +0000 (02:46 +0000)] 
man: Note the -x/-X quirk for truncated packets [skip ci]

Accurate skipping of the link level header was working before the
conversion started, it will hopefully work after the conversion is
complete, but meanwhile be clear about what it is now.

4 years agoNSH: Modernize packet parsing style.
Denis Ovsienko [Sun, 20 Dec 2020 03:55:12 +0000 (03:55 +0000)] 
NSH: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Remove a redundant ND_TCHECK_LEN()
instance and make another one conditional. Report invalid packets as
invalid with a reason, not truncated.

Update the code from draft-ietf-sfc-nsh-01 to RFC 8300: remove the no
longer existent C-bit, add the TTL field, adjust the MD Type field
offset and size, apply correct mask to TLV length, redo TLV length in
bytes instead of 4-byte words and mind the padding.

Fetch and print one header at a time. Add and use two lookup tables for
MD Type and Next Protocol. Add a version number check. Add a length
check for MD Type 1. Update some error messages. Add a few encoding
diagrams for clarity. Lose a few variables and reduce scope of the
remaining variables. Update a few tests.

4 years agoCirrus CI: Use FreeBSD 12.2
Denis Ovsienko [Sun, 20 Dec 2020 02:44:25 +0000 (02:44 +0000)] 
Cirrus CI: Use FreeBSD 12.2

4 years agoSMB: Disable the printer by default
Francois-Xavier Le Bail [Sat, 19 Dec 2020 10:59:32 +0000 (11:59 +0100)] 
SMB: Disable the printer by default

Like in 4.9.3 version.
This printer needs rework.

Move the tests with SMB packets in tests/smb.tests.
Add outputs files for the disabled case.

4 years agoJuniper: initialize some structures
Francois-Xavier Le Bail [Fri, 18 Dec 2020 18:19:41 +0000 (19:19 +0100)] 
Juniper: initialize some structures

This change fixes the GH issue #801.

Same way as commit 88135db7c785661e7a8b0c02d3ef0bfd00cce6aa.

4 years agoMPTCP: Modernize packet parsing style.
Denis Ovsienko [Thu, 10 Dec 2020 01:21:00 +0000 (01:21 +0000)] 
MPTCP: Modernize packet parsing style.

Remove the last ND_TCHECK*() instance, which was redundant. Rewrite some
code to articulate the hidden GET_U_1() instances.

4 years agoMPLS: Modernize packet parsing style.
Denis Ovsienko [Thu, 10 Dec 2020 01:02:52 +0000 (01:02 +0000)] 
MPLS: Modernize packet parsing style.

Enable ND_LONGJMP_FROM_TCHECK. Remove both ND_TCHECK*() instances
because they are redundant. Report invalid packets as invalid, not
truncated. Test whether the invalid packet is entirely in the buffer.
Replace a long switch block with a ternary assignment.

4 years agoPFLOG: Use nd_printjnp instead of %s conversion specifier
Francois-Xavier Le Bail [Mon, 14 Dec 2020 21:15:48 +0000 (22:15 +0100)] 
PFLOG: Use nd_printjnp instead of %s conversion specifier

4 years agoPFLOG: Try to fix previous commit
Francois-Xavier Le Bail [Mon, 14 Dec 2020 21:02:01 +0000 (22:02 +0100)] 
PFLOG: Try to fix previous commit

The error was:
./print-pflog.c:99:20: error: passing 'char const[16]' to parameter
of type 'const u_char *' (aka 'const unsigned char *') converts
between pointers to integer types with different sign
[-Werror,-Wpointer-sign]
                nd_printjnp(ndo, hdr->ruleset, PFLOG_RULESET_NAME_SIZE);
                                 ^~~~~~~~~~~~
./netdissect.h:397:61: note: passing argument to parameter here
extern void nd_printjnp(netdissect_options *, const u_char *, u_int);
                                                            ^

4 years agoPFLOG: Use nd_printjnp() instead of %s conversion specifier
Francois-Xavier Le Bail [Mon, 14 Dec 2020 20:18:06 +0000 (21:18 +0100)] 
PFLOG: Use nd_printjnp() instead of %s conversion specifier

This change add a bounds checks.

4 years agoFix some typos
Francois-Xavier Le Bail [Sun, 13 Dec 2020 12:38:22 +0000 (13:38 +0100)] 
Fix some typos

[skip ci]

4 years agoENC: Update a macro argument name avoiding it will be flagged as a typo
Francois-Xavier Le Bail [Sat, 12 Dec 2020 21:24:31 +0000 (22:24 +0100)] 
ENC: Update a macro argument name avoiding it will be flagged as a typo

[skip ci]

4 years agoFix some typos
Francois-Xavier Le Bail [Sat, 12 Dec 2020 15:10:25 +0000 (16:10 +0100)] 
Fix some typos

[skip ci]

4 years agoDHCPv6: Update the MUD URL option output
Francois-Xavier Le Bail [Sat, 12 Dec 2020 12:23:27 +0000 (13:23 +0100)] 
DHCPv6: Update the MUD URL option output

Replace '=' by ' ' between the option name and the value like in other
cases.

Update the output of a test accordingly.

4 years agoDHCPv6: Replace the (void)nd_printn() calls by nd_printjnp() calls
Francois-Xavier Le Bail [Sat, 12 Dec 2020 12:14:34 +0000 (13:14 +0100)] 
DHCPv6: Replace the (void)nd_printn() calls by nd_printjnp() calls

There is no null byte in the middle of these option values.

Remove an unnecessary cast.

4 years agoReplace '(void)nd_print()' calls by nd_printjnp() calls
Francois-Xavier Le Bail [Fri, 11 Dec 2020 09:20:58 +0000 (10:20 +0100)] 
Replace '(void)nd_print()' calls by nd_printjnp() calls

'(void)nd_print(ndo, start, start + len)' are replaced by
'nd_printjnp(ndo, start, len)'

4 years agoRemove the no more used nd_printzp() function
Francois-Xavier Le Bail [Thu, 10 Dec 2020 21:49:21 +0000 (22:49 +0100)] 
Remove the no more used nd_printzp() function

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

4 years agoRIP: Replace the 'if (nd_printzp()) return' by nd_printjnp() call
Francois-Xavier Le Bail [Thu, 10 Dec 2020 21:22:04 +0000 (22:22 +0100)] 
RIP: Replace the 'if (nd_printzp()) return' by nd_printjnp() call

4 years agoISIS: Replace the 'if (nd_printzp()) goto trunc' by nd_printjnp() calls
Francois-Xavier Le Bail [Thu, 10 Dec 2020 20:23:46 +0000 (21:23 +0100)] 
ISIS: Replace the 'if (nd_printzp()) goto trunc' by nd_printjnp() calls

Moreover:
Use the sizeof operator.