Skip to content

Commit e428e03

Browse files
committed
Import tcpdump 4.99.6 (previous was 4.99.5)
Tuesday, December 30, 2025 / The Tcpdump Group Summary for 4.99.6 tcpdump release Remove protocol decoding for: OTV (draft-hasmit-otv-04, this Internet-Draft is no longer active). Refine protocol decoding for: DNS: Use ND_TCHECK_LEN() instead of a custom bounds check. IPv6: Add a missing comma and remove a colon in the output. TCP: Note if the Urgent Pointer is non-zero while URG flag not set, if the verbose level is > 1 (option -vv and more). TCP: Note if the Acknowledgment Number is non-zero while ACK flag not set, if the verbose level is > 1 (option -vv and more). TCP: Fix Reset segment processing. IP, IPv6: Fix setting the snapshot length for the payload. IP: Use ND_TTEST_LEN() instead of a custom bounds check. frag6: Add a bounds check in non-verbose mode. PTP: Remove spaces before colons in output. PTP: Fix management packet fields. ISO: Avoid undefined behavior and integer overflow in the Fletcher checksum calculation. NFS: Delete dead code. BOOTP: Use an uint16_t variable to get the result of a GET_BE_U_2(). ZEP: use the existing NTP time formatting code. NTP: Fix p_ntp_time_fmt() using epoch 1/epoch 2 convention (RFC 4330). NTP: Update a field name with the RFC 5905 name (Origin Timestamp). IPv6 mobility: Modernize packet parsing and make fixes. IP6OPTS: Modernize packet parsing and make fixes. VXLAN: Add UDP port 8472 used by Linux as the default port. EGP: Replace custom code with tok2str(); Modernize packet parsing and fix printing with -v option. User interface: Add optional unit suffix on -C file size. Improve the handling of size suffixes for -C. Print errors for options -A, -x[x] and -X[X] (mutually exclusive). Print errors about -C, -G and -z options usage. For PCAP_ERROR_CAPTURE_NOTSUP, show the error message provided by libpcap for that error if it's non-empty. Update the -z option processing. Print "invalid option -- z" when it is. Add the -g option, causing IPv4 output in verbose mode to be on one line. Other: Avoid race condition when receiving signal during shutdown. Always show the interface name in error messages when the interface can't be opened. Clean up the message shown if a -i flag is specified with an interface index that's too large. Source code: Fix '-tt' option printing when time > 2106-02-07T06:28:15Z. Add sub-second packet timestamp checks for invalid micro/nano. Remove unused missing/snprintf.c. Fix incompatible pointer types with time functions calls on Windows. Use C99 macros to define 64-bit constants and maximum 64-bit values. Windows: Fixed to find wpcap.dll if WinPcap isn't installed and Npcap was installed without the WinPcap API compatibility option. (GitHub issue #1226). Building and testing: Makefile.in: Use a local libpcap in the releasecheck target. CMake: Fix build with CMake 3.31. autotools, CMake: don't separately test whether snprintf(3) is available and whether it's suitable - the test for whether it's suitable also fails if it's unavailable. CMake: Skip snprintf(3) tests when cross-compiling. autotools, CMake: fix issues with snprintf test and sanitizers. CMake: check whether check_c_source_runs() works, treat the build as a cross-compile if it doesn't work. Autoconf: Use AC_SYS_YEAR2038_RECOMMENDED when possible if the environment variable BUILD_YEAR2038 = yes (via autogen.sh). Autoconf: Avoid incorrectly include the libpcap's config.h. Autoconf: Refine reporting of os-proto.h. Require config.h to be from the tcpdump build. AppVeyor: Update Npcap SDK to 1.15. autogen.sh: Allow to configure Autoconf warnings. autogen.sh: Delete all trailing blank lines at end of configure.
1 parent 55e58d4 commit e428e03

File tree

441 files changed

+2723
-2032
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

441 files changed

+2723
-2032
lines changed

external/bsd/tcpdump/dist/CHANGES

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,76 @@
1+
Tuesday, December 30, 2025 / The Tcpdump Group
2+
Summary for 4.99.6 tcpdump release
3+
Remove protocol decoding for:
4+
OTV (draft-hasmit-otv-04, this Internet-Draft is no longer active).
5+
Refine protocol decoding for:
6+
DNS: Use ND_TCHECK_LEN() instead of a custom bounds check.
7+
IPv6: Add a missing comma and remove a colon in the output.
8+
TCP: Note if the Urgent Pointer is non-zero while URG flag not set,
9+
if the verbose level is > 1 (option -vv and more).
10+
TCP: Note if the Acknowledgment Number is non-zero while ACK flag not set,
11+
if the verbose level is > 1 (option -vv and more).
12+
TCP: Fix Reset segment processing.
13+
IP, IPv6: Fix setting the snapshot length for the payload.
14+
IP: Use ND_TTEST_LEN() instead of a custom bounds check.
15+
frag6: Add a bounds check in non-verbose mode.
16+
PTP: Remove spaces before colons in output.
17+
PTP: Fix management packet fields.
18+
ISO: Avoid undefined behavior and integer overflow in the Fletcher
19+
checksum calculation.
20+
NFS: Delete dead code.
21+
BOOTP: Use an uint16_t variable to get the result of a GET_BE_U_2().
22+
ZEP: use the existing NTP time formatting code.
23+
NTP: Fix p_ntp_time_fmt() using epoch 1/epoch 2 convention (RFC 4330).
24+
NTP: Update a field name with the RFC 5905 name (Origin Timestamp).
25+
IPv6 mobility: Modernize packet parsing and make fixes.
26+
IP6OPTS: Modernize packet parsing and make fixes.
27+
VXLAN: Add UDP port 8472 used by Linux as the default port.
28+
EGP: Replace custom code with tok2str(); Modernize packet parsing and
29+
fix printing with -v option.
30+
User interface:
31+
Add optional unit suffix on -C file size.
32+
Improve the handling of size suffixes for -C.
33+
Print errors for options -A, -x[x] and -X[X] (mutually exclusive).
34+
Print errors about -C, -G and -z options usage.
35+
For PCAP_ERROR_CAPTURE_NOTSUP, show the error message provided
36+
by libpcap for that error if it's non-empty.
37+
Update the -z option processing. Print "invalid option -- z" when it is.
38+
Add the -g option, causing IPv4 output in verbose mode to be on one line.
39+
Other:
40+
Avoid race condition when receiving signal during shutdown.
41+
Always show the interface name in error messages when the
42+
interface can't be opened.
43+
Clean up the message shown if a -i flag is specified with an
44+
interface index that's too large.
45+
Source code:
46+
Fix '-tt' option printing when time > 2106-02-07T06:28:15Z.
47+
Add sub-second packet timestamp checks for invalid micro/nano.
48+
Remove unused missing/snprintf.c.
49+
Fix incompatible pointer types with time functions calls on Windows.
50+
Use C99 macros to define 64-bit constants and maximum 64-bit values.
51+
Windows:
52+
Fixed to find wpcap.dll if WinPcap isn't installed and Npcap was
53+
installed without the WinPcap API compatibility option. (GitHub
54+
issue #1226).
55+
Building and testing:
56+
Makefile.in: Use a local libpcap in the releasecheck target.
57+
CMake: Fix build with CMake 3.31.
58+
autotools, CMake: don't separately test whether snprintf(3) is
59+
available and whether it's suitable - the test for whether it's
60+
suitable also fails if it's unavailable.
61+
CMake: Skip snprintf(3) tests when cross-compiling.
62+
autotools, CMake: fix issues with snprintf test and sanitizers.
63+
CMake: check whether check_c_source_runs() works, treat the build
64+
as a cross-compile if it doesn't work.
65+
Autoconf: Use AC_SYS_YEAR2038_RECOMMENDED when possible if the
66+
environment variable BUILD_YEAR2038 = yes (via autogen.sh).
67+
Autoconf: Avoid incorrectly include the libpcap's config.h.
68+
Autoconf: Refine reporting of os-proto.h.
69+
Require config.h to be from the tcpdump build.
70+
AppVeyor: Update Npcap SDK to 1.15.
71+
autogen.sh: Allow to configure Autoconf warnings.
72+
autogen.sh: Delete all trailing blank lines at end of configure.
73+
174
Friday, August 30, 2024 / The Tcpdump Group
275
Summary for 4.99.5 tcpdump release
376
Refine protocol decoding for:
@@ -38,7 +111,7 @@ Friday, August 30, 2024 / The Tcpdump Group
38111
OSPF: Pad TLVs in LS_OPAQUE_TYPE_RI to multiples of 4 bytes.
39112
OSPF: Update LS-Ack printing not to run off the end of the packet.
40113
OSPF6: Fix an undefined behavior.
41-
pflog: use nd_ types in struct pfloghdr.
114+
pflog: Use nd_ types in struct pfloghdr.
42115
PPP: Check if there is some data to hexdump.
43116
PPP: Remove an extra colon before LCP Callback Operation.
44117
Use the buffer stack for de-escaping PPP; fixes CVE-2024-2397;
@@ -122,6 +195,7 @@ Friday, August 30, 2024 / The Tcpdump Group
122195
Make various improvements to the man page.
123196
Add initial README file for Haiku.
124197
Make various improvements to CONTRIBUTING.md.
198+
man: Clarify the "any" pseudo-interface further.
125199

126200
Friday, April 7, 2023 / The Tcpdump Group
127201
Summary for 4.99.4 tcpdump release
@@ -179,7 +253,7 @@ Saturday, December 31, 2022 / The Tcpdump Group
179253
802.11: Fetch the CF and TIM IEs a field at a time.
180254
802.15.4, BGP, LISP: fix some length checks, compiler warnings,
181255
and undefined behavior warnings.
182-
PFLOG: handle LINKTYPE_PFLOG/DLT_PFLOG files from all OSes on all
256+
PFLOG: Handle LINKTYPE_PFLOG/DLT_PFLOG files from all OSes on all
183257
OSes.
184258
RRCP: support more Realtek protocols than just RRCP.
185259
MPLS: show the EXP field as TC, as per RFC 5462.

external/bsd/tcpdump/dist/CMakeLists.txt

Lines changed: 120 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,21 @@ else(WIN32)
1313
# on a "long-term support" version # of some OS and that
1414
# version supplies an older version of CMake;
1515
#
16-
# otherwise, require 3.5, so we don't get messages warning
17-
# that support for versions of CMake lower than 3.5 is
16+
# otherwise, if it's a version less than 3.10, require only
17+
# 3.5, just in case somebody is configuring with CMake
18+
# on a "long-term support" version # of some OS and that
19+
# version supplies an older version of CMake;
20+
#
21+
# otherwise, require 3.10, so we don't get messages warning
22+
# that support for versions of CMake lower than 3.10 is
1823
# deprecated.
1924
#
2025
if(CMAKE_VERSION VERSION_LESS "3.5")
2126
cmake_minimum_required(VERSION 2.8.12)
22-
else()
27+
elseif(CMAKE_VERSION VERSION_LESS "3.10")
2328
cmake_minimum_required(VERSION 3.5)
29+
else()
30+
cmake_minimum_required(VERSION 3.10)
2431
endif()
2532
endif(WIN32)
2633

@@ -392,6 +399,35 @@ if(MSVC)
392399
endif (USE_STATIC_RT)
393400
endif(MSVC)
394401

402+
#
403+
# CMake's definition of "cross-compiling" appears to be "compiling
404+
# for an *operating system* other than the one on which the build
405+
# is being done*.
406+
#
407+
# This is an inadequate definition, as people build for the same
408+
# operating system but a different instruction set, e.g. building
409+
# on an IA-32 or x86-64 Linux box for an Arm embedded Linux box,
410+
# or building Arm code on an IA-32 or x86-64 Windows box.
411+
#
412+
# So just test whether check_c_source_runs() on a trivial program
413+
# works; if not, it's probably because the generated code won't
414+
# run on the platform on which we're running.
415+
#
416+
include(CheckCSourceRuns)
417+
if (NOT CMAKE_CROSSCOMPILING)
418+
check_c_source_runs("
419+
int main()
420+
{
421+
return 0;
422+
}
423+
"
424+
CHECK_C_SOURCE_RUNS_WORKS
425+
)
426+
if (NOT CHECK_C_SOURCE_RUNS_WORKS)
427+
set(CMAKE_CROSSCOMPILING TRUE)
428+
endif()
429+
endif()
430+
395431
###################################################################
396432
# Detect available platform features
397433
###################################################################
@@ -407,11 +443,16 @@ include(CheckVariableExists)
407443
include(CheckTypeSize)
408444

409445
#
410-
# Get the size of a time_t, to know whether it's 32-bit or 64-bit.
446+
# Get the size of a time_t, to know whether it's 32-bit or 64-bit. Print it.
411447
#
412448
cmake_push_check_state()
413449
set(CMAKE_EXTRA_INCLUDE_FILES time.h)
414450
check_type_size("time_t" SIZEOF_TIME_T)
451+
if(SIZEOF_TIME_T EQUAL 4)
452+
message(STATUS "32-bit time_t")
453+
elseif(SIZEOF_TIME_T EQUAL 8)
454+
message(STATUS "64-bit time_t")
455+
endif()
415456
cmake_pop_check_state()
416457

417458
#
@@ -493,67 +534,77 @@ else(STDLIBS_HAVE_GETSERVENT)
493534
endif(STDLIBS_HAVE_GETSERVENT)
494535
cmake_pop_check_state()
495536

496-
#
497-
# Make sure we have snprintf(); we require it.
498-
# We use check_symbol_exists(), as it isn't necessarily an external
499-
# function - in Visual Studio, for example, it is an inline function
500-
# calling an external function.
501-
#
502-
check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
503-
if(NOT HAVE_SNPRINTF)
504-
message(FATAL_ERROR "snprintf() is required but wasn't found")
505-
endif()
506-
507-
#
508-
# Require a proof of suitable snprintf(3), same as in Autoconf.
509-
#
510-
include(CheckCSourceRuns)
511-
check_c_source_runs("
512-
#include <stdio.h>
513-
#include <string.h>
514-
#include <inttypes.h>
515-
#include <sys/types.h>
516-
517-
int main()
518-
{
519-
char buf[100];
520-
uint64_t t = (uint64_t)1 << 32;
521-
522-
snprintf(buf, sizeof(buf), \"%zu\", sizeof(buf));
523-
if (strncmp(buf, \"100\", sizeof(buf)))
524-
return 1;
525-
526-
snprintf(buf, sizeof(buf), \"%zd\", -sizeof(buf));
527-
if (strncmp(buf, \"-100\", sizeof(buf)))
528-
return 2;
529-
530-
snprintf(buf, sizeof(buf), \"%\" PRId64, -t);
531-
if (strncmp(buf, \"-4294967296\", sizeof(buf)))
532-
return 3;
533-
534-
snprintf(buf, sizeof(buf), \"0o%\" PRIo64, t);
535-
if (strncmp(buf, \"0o40000000000\", sizeof(buf)))
536-
return 4;
537-
538-
snprintf(buf, sizeof(buf), \"0x%\" PRIx64, t);
539-
if (strncmp(buf, \"0x100000000\", sizeof(buf)))
540-
return 5;
541-
542-
snprintf(buf, sizeof(buf), \"%\" PRIu64, t);
543-
if (strncmp(buf, \"4294967296\", sizeof(buf)))
544-
return 6;
545-
546-
return 0;
547-
}
548-
549-
"
550-
SUITABLE_SNPRINTF
551-
)
552-
if(NOT SUITABLE_SNPRINTF)
553-
message(FATAL_ERROR
537+
if (NOT CMAKE_CROSSCOMPILING)
538+
#
539+
# Require a proof of suitable snprintf(3), same as in Autoconf.
540+
#
541+
check_c_source_runs("
542+
#include <stdio.h>
543+
#include <string.h>
544+
#include <inttypes.h>
545+
#include <sys/types.h>
546+
547+
#if defined(_WIN32) && !defined(_SSIZE_T_DEFINED)
548+
/*
549+
* On UN*Xes, this is a signed integer type of the same size as size_t.
550+
*
551+
* It's not defined by Visual Studio; we assume that ptrdiff_t will
552+
* be a type that is a signed integer type of the same size as size_t.
553+
*/
554+
typedef ptrdiff_t ssize_t;
555+
#endif
556+
557+
/*
558+
* Avoid trying to cast negative values to unsigned types, or doing
559+
* shifts of signed types, in order not to have the test program fail
560+
* if we're building with undefined-behavior sanitizers enabled.
561+
*/
562+
int main()
563+
{
564+
char buf[100];
565+
unsigned int ui = sizeof(buf);
566+
int i = sizeof(buf);
567+
int64_t i64 = INT64_C(0x100000000);
568+
uint64_t ui64 = UINT64_C(0x100000000);
569+
570+
snprintf(buf, sizeof(buf), \"%zu\", (size_t)ui);
571+
if (strncmp(buf, \"100\", sizeof(buf)))
572+
return 1;
573+
574+
snprintf(buf, sizeof(buf), \"%zd\", (ssize_t)(-i));
575+
if (strncmp(buf, \"-100\", sizeof(buf)))
576+
return 2;
577+
578+
snprintf(buf, sizeof(buf), \"%\" PRId64, -i64);
579+
if (strncmp(buf, \"-4294967296\", sizeof(buf)))
580+
return 3;
581+
582+
snprintf(buf, sizeof(buf), \"0o%\" PRIo64, ui64);
583+
if (strncmp(buf, \"0o40000000000\", sizeof(buf)))
584+
return 4;
585+
586+
snprintf(buf, sizeof(buf), \"0x%\" PRIx64, ui64);
587+
if (strncmp(buf, \"0x100000000\", sizeof(buf)))
588+
return 5;
589+
590+
snprintf(buf, sizeof(buf), \"%\" PRIu64, ui64);
591+
if (strncmp(buf, \"4294967296\", sizeof(buf)))
592+
return 6;
593+
594+
return 0;
595+
}
596+
597+
"
598+
SUITABLE_SNPRINTF
599+
)
600+
if(NOT SUITABLE_SNPRINTF)
601+
message(FATAL_ERROR
554602
"The snprintf(3) implementation in this libc is not suitable,
555603
tcpdump would not work correctly even if it managed to compile."
556-
)
604+
)
605+
endif()
606+
else()
607+
message(STATUS "Skipped SUITABLE_SNPRINTF because cross-compiling.")
557608
endif()
558609

559610
check_function_exists(getopt_long HAVE_GETOPT_LONG)
@@ -908,7 +959,7 @@ check_function_exists(pcap_dump_ftell64 HAVE_PCAP_DUMP_FTELL64)
908959
# we should check for it, so that we can use it if it's present.
909960
#
910961
# So we check for pcap_open() and pcap_findalldevs_ex() if 1) this isn't
911-
# macOS or 2) the the libpcap we found is not a system library, meaning
962+
# macOS or 2) the libpcap we found is not a system library, meaning
912963
# that its path begins neither with /usr/lib (meaning it's a system
913964
# dylib) nor /Application/Xcode.app (meaning it's a file in
914965
# the Xcode SDK).
@@ -1160,6 +1211,7 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel)
11601211
check_and_add_compiler_option(-Wall)
11611212
check_and_add_compiler_option(-Wassign-enum)
11621213
check_and_add_compiler_option(-Wcast-qual)
1214+
check_and_add_compiler_option(-Wcomma)
11631215
check_and_add_compiler_option(-Wmissing-prototypes)
11641216
check_and_add_compiler_option(-Wmissing-variable-declarations)
11651217
check_and_add_compiler_option(-Wold-style-definition)
@@ -1331,7 +1383,6 @@ set(NETDISSECT_SOURCE_LIST_C
13311383
print-openflow.c
13321384
print-ospf.c
13331385
print-ospf6.c
1334-
print-otv.c
13351386
print-pflog.c
13361387
print-pgm.c
13371388
print-pim.c
@@ -1496,6 +1547,9 @@ add_executable(tcpdump ${TCPDUMP_SOURCE_LIST_C})
14961547
if(NOT C_ADDITIONAL_FLAGS STREQUAL "")
14971548
set_target_properties(tcpdump PROPERTIES COMPILE_FLAGS ${C_ADDITIONAL_FLAGS})
14981549
endif()
1550+
if(NOT "${PCAP_LINK_FLAGS}" STREQUAL "")
1551+
set_target_properties(tcpdump PROPERTIES LINK_FLAGS ${PCAP_LINK_FLAGS})
1552+
endif()
14991553
target_link_libraries(tcpdump netdissect ${TCPDUMP_LINK_LIBRARIES})
15001554

15011555
######################################
@@ -1551,7 +1605,7 @@ add_custom_target(uninstall
15511605
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
15521606

15531607
#
1554-
# Tcpdump tests
1608+
# tcpdump tests
15551609
# We try to find the Perl interpreter and, if we do, we have the check
15561610
# rule run tests/TESTrun with it, because just trying to run the TESTrun
15571611
# script as a command won't work on Windows.

external/bsd/tcpdump/dist/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ and ask!
3939
1) Check that there isn't a pull request already opened for the changes you
4040
intend to make.
4141

42-
2) [Fork](https://help.github.com/articles/fork-a-repo/) the Tcpdump
42+
2) [Fork](https://help.github.com/articles/fork-a-repo/) the tcpdump
4343
[repository](https://github.com/the-tcpdump-group/tcpdump).
4444

4545
3) The easiest way to test your changes on multiple operating systems and

external/bsd/tcpdump/dist/INSTALL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ directory), do the following steps:
1818
run `./autogen.sh` (a shell script). The autogen.sh script will
1919
build the `configure` and `config.h.in` files.
2020

21+
* If you build on a Linux 32-bit system, with Autoconf version >= 2.72
22+
and GNU C Library version >= 2.34, run `export BUILD_YEAR2038=yes`
23+
before running `./autogen.sh` to build with 64-bit time_t (Y2038-safe).
24+
2125
On some system, you may need to set the `AUTORECONF` variable, like:
2226
`AUTORECONF=autoreconf-2.69 ./autogen.sh`
2327
to select the `autoreconf` version you want to use.

0 commit comments

Comments
 (0)