summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Cirrus CI: Configure with --enable-instrument-functions, Coverity taskcoverity_scanFrancois-Xavier Le Bail2023-03-131-2/+2
| | | | | | Add the required binutils-dev package. [skip ci]
* instrument functions: Use an environment variable instead of config filesFrancois-Xavier Le Bail2023-03-134-56/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the environment variable INSTRUMENT is - unset or set to an empty string, print nothing, like with no instrumentation - set to "all" or "a", print all the functions names - set to "global" or "g", print only the global functions names The configuration with --enable-instrument-functions remains. Note that before this change, the default was to print all functions. Now it is to print nothing. So by default 'make check' runs without errors. This allows to run: $ INSTRUMENT=a ./tcpdump ... $ INSTRUMENT=g ./tcpdump ... $ INSTRUMENT= ./tcpdump ... or $ export INSTRUMENT=global $ ./tcpdump ... This also allows to run the statically compiled binary on another host after copying it. It is no longer necessary to modify the configuration with: $ make instrument_all $ make instrument_global $ make instrument_off (Targets removed.) Update .gitignore, CONTRIBUTING.md and Makefile.in accordingly. Moreover: Reduce the scope of a variable. Rename a variable. Remove '\n' in the perror() call. Remove 2 spaces in function calls (style). [skip ci]
* man: Spell TCP header flags names. [skip ci]Denis Ovsienko2023-03-121-3/+3
| | | | | | | | | | | | | In the prose use the names from respective registry [1], which says: * "PSH", not "PUSH", * "CWR", not "ECN CWR", and * "ECE", not "ECN-Echo". This does not resolve all known inconsistencies related to TCP flags, but at least makes the problem smaller. 1: https://www.iana.org/assignments/tcp-parameters/tcp-parameters.xhtml
* instrument functions: Add a NULL checkFrancois-Xavier Le Bail2023-03-111-1/+2
| | | | | | | | Same as in tcpslice to fix a Coverity issue. The issue was: Null pointer dereferences (FORWARD_NULL) Passing null pointer "func" to "strncmp", which dereferences it.
* instrument functions: Add a length checkFrancois-Xavier Le Bail2023-03-111-1/+6
| | | | | | | | | We need space for the '\0'. Same as in tcpslice to fix a Coverity issue. Moreover: Use '\0' for the null character.
* Refine the patterns in .gitignore. [skip ci]Denis Ovsienko2023-03-051-21/+19
| | | | | Spell patterns that are supposed to apply at the source tree root only and remove two patterns that already appear in tests/.gitignore.
* Get Markdown right in the previous change. [skip ci]Denis Ovsienko2023-03-041-1/+1
| | | | HTML 3 had problems, but confusing italic for bold was not one of them.
* Fix minor issues in INSTALL.md. [skip ci]Denis Ovsienko2023-03-041-5/+5
|
* Makefile.in: Add instrument-functions.o in CLEANFILESFrancois-Xavier Le Bail2023-03-011-1/+2
| | | | | | It is not in LIBNETDISSECT_OBJ because it is optionally built. [skip ci]
* Makefile.in: Add print-smb.o and smbutil.o in CLEANFILESFrancois-Xavier Le Bail2023-03-011-1/+1
| | | | | | They are not in LIBNETDISSECT_OBJ because they are optionally built. [skip ci]
* Cirrus CI: Configure with --enable-smb in the Coverity taskFrancois-Xavier Le Bail2023-02-271-1/+1
|
* Rename a test. The protocol is IEEE 802.11Francois-Xavier Le Bail2023-02-273-1/+1
|
* man: Add the TCP flag names tcp-ece and tcp-cwrFrancois-Xavier Le Bail2023-02-261-1/+8
| | | | | State that these flag names became available when linking with libpcap 1.9.0 or later.
* doc: Update Haiku particulars. [skip ci]Denis Ovsienko2023-02-261-0/+16
| | | | Add a section for the 32-bit version.
* Untangle detection of pcap_findalldevs().Denis Ovsienko2023-02-252-31/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tcpdump.c requires both HAVE_PCAP_IF_T and HAVE_PCAP_FINDALLDEVS to manage the code that depends on pcap_findalldevs(). Other than that, the Autoconf and CMake checks that produce these two macros do not relate directly, so having the check for pcap_if_t conditional on the check for pcap_findalldevs() is an unnecessary complication. More importantly, in the CMake case this places the check_type_size() for pcap_if_t into a context with CMAKE_REQUIRED_LIBRARIES already set to PCAP_LIBRARIES. This works only if check_type_size() does not have to check for <sys/types.h>, <stdint.h> or <stddef.h> implicitly. This was the case so long as another check_type_size() before the CMAKE_REQUIRED_LIBRARIES change made the implicit checks and cached the results, but removing that earlier instance resulted in a warning: Policy CMP0075 is not set: Include file check macros honor CMAKE_REQUIRED_LIBRARIES. Run "cmake --help-policy CMP0075" for policy details. Use the cmake_policy command to set the policy and suppress this warning. CMAKE_REQUIRED_LIBRARIES is set to: /usr/lib/x86_64-linux-gnu/libpcap.so For compatibility with CMake 3.11 and below this check is ignoring it. To fix that, in both Autoconf and CMake make the two checks separate and unconditional and place the check for pcap_if_t where it fits better. In CMake remove the earlier workaround with in6_addr.
* CI: Introduce TEST_RELEASETAR. [skip ci]Denis Ovsienko2023-02-251-1/+4
| | | | Same as in tcpslice and libpcap.
* tcpdump.c: fix a comment. [skip ci]Guy Harris2023-02-251-1/+1
| | | | | | | Some versions of Mac OS X (as it was then called) *did*, in fact, ship with a libpcap that had pcap_findalldevs() but a pcap.h that didn't define pcap_if_t; it's not a question of "may ship", it's a fact of "did ship".
* State there are currently no OS dependent defines and prototypesFrancois-Xavier Le Bail2023-02-241-1/+1
| | | | | The last header was removed by commit 6008cb83b72a8fafe9c69f6955f4bdffbc049a09.
* CMake: balance cmake_push_check_state() and cmake_pop_check_state().Guy Harris2023-02-221-0/+1
| | | | | We didn't completely pop the check state after we finished the checks for libpcap.
* Detect OS IPv6 support using AF_INET6 only.Denis Ovsienko2023-02-227-86/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | tcpdump source code has not been using struct in6_addr since commit 0c9cfdc in 2019, so lose the conditional structure declaration, which is a no-op. Since commit de7c619 in 2015 netdissect-stdinc.h on Windows defines HAVE_OS_IPV6_SUPPORT if AF_INET6 if defined, which makes it equivalent to AF_INET6. On Unix-like systems taking struct in6_addr out of scope would make HAVE_OS_IPV6_SUPPORT equivalent to AF_INET6, thus after removing struct in6_addr remove HAVE_OS_IPV6_SUPPORT together with Autoconf and CMake checks that define it. Leave an unrelated CMake workaround in place for later debugging. On Windows do not define AF_INET6 if it is not defined, which makes AF_INET6 a universal indicator of the OS IPv6 support on all supported OSes. The few remaining use cases that genuinely need AF_INET6 use it to make OS API calls, so if the macro is not defined, it most likely means such an API call in the best case would return just a well-formed error status. With this in mind, in win32_gethostbyaddr() and ip6addr_string() guard all IPv6-specific code with #ifdef AF_INET6. In tcpdump.c add a comment to note why a guard is not required for Casper-specific conditional code that uses AF_INET6. This way when the OS does not support IPv6, IPv6 addresses will not resolve to names, which is expected. Other than that, tcpdump should be able to process IPv6 addresses the usual way regardless if the OS would be able to process the packets with these addresses.
* Switch print-isoclns.c to AFNUM_ code points. [skip ci]Denis Ovsienko2023-02-221-12/+13
| | | | | Same as in other printers just before, since this use case is neither the OS API nor the wire encoding,
* Autoconf: Remove detection of early IPv6 stacks. [skip appveyor]Denis Ovsienko2023-02-212-118/+1
| | | | | | | | The KAME/INRIA/etc. block has been around since commit c9d84d1 in 1999, when it was common for IPv6 stacks to exist and develop separately from operating systems. During the next 10 or so years IPv6 support in various operating systems became the norm and the stack detector became obsolete. Remove it and continue to use libc IPv6 implementation.
* Rename AF_INET{6} to AF_IP{6}.Guy Harris2023-02-209-88/+88
| | | | | That matches the descriptiions in the registry, and indicates that they don't correspond to any AF_ values.
* Rename the BSD_AFNUM_ values to BSD_AF_.Guy Harris2023-02-206-35/+35
| | | | | | They correspond to OS socket API AF_ values, which are distinct from address family numbers in the IANA registry at https://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml
* pim: use af.h values for the address family.Guy Harris2023-02-201-11/+11
| | | | | | Use them in the case statement testing the address family from the packet, and use them, rather than AF_ values, to indicate the address family from the packet.
* CHANGES: Add a change backported to 4.99Francois-Xavier Le Bail2023-02-201-0/+1
| | | | [skip ci]
* CHANGES: Move a change backported to 4.99Francois-Xavier Le Bail2023-02-201-1/+1
| | | | [skip ci]
* Do not substitute strdup().Denis Ovsienko2023-02-198-69/+3
| | | | | | | | | | | | libpcap has been using strdup() for a long time too, but never substituted it under the assumption the function is available in all supported OSes, see libpcap commit cb71eef from 2006. The only exception to that is Windows, which can have a different name for the function, but both libpcap and tcpdump for that already use a separate workaround, which does not involve the substitution. Let's take this as a proof that strdup() substitution in tcpdump is dead code, and remove it.
* Simplify conditional branching in diag-control.h.Denis Ovsienko2023-02-191-23/+28
| | | | (Same as in tcpslice and libpcap.)
* Geneve: Fix the Geneve UDP port testFrancois-Xavier Le Bail2023-02-171-1/+1
| | | | GENEVE_PORT (6081) is a destination port.
* instrument functions: Minimize stat() callsFrancois-Xavier Le Bail2023-02-171-1/+8
| | | | | | | This change decreases the execution time when the file indicating that instrumentation is "off" exists. [skip ci]
* Lose Digital UNIX 4.x prototype header.Denis Ovsienko2023-02-172-25/+0
| | | | | | | The final 4.x release 4.0F dates back to 1999, and the only prototypes in the header are snprintf(), which became available in Tru64 UNIX 5.0 (as far as libpcap lbl/os-osf5.h mentions it), and vsnprintf(), which tcpdump does not use any more.
* Do not require vsnprintf().Denis Ovsienko2023-02-172-12/+6
| | | | | | | The check for vsnprintf() has been in the configure script since commit 8cb054c in 2000, and the only actual use of the function was in the "#ifndef HAVE_SNPRINTF" block in missing/snprintf.c until commit 1ed63b5 in 2019. Since then tcpdump does not require vsnprintf() in any way.
* Require a proof of suitable snprintf(3) implementation.Denis Ovsienko2023-02-166-165/+122
| | | | | | | | | | | My earlier commit fbd4415 did a wrong thing because it caused a failure to fail in "make check" on Solaris 9, whereas the right thing to do when printf() does not work as expected would be to fail the build with a useful error message. Implement that by testing snprintf() in Autoconf and CMake (assume that in a given libc implementation all functions in the printf() family have the same level of support for conversion specifications). Return 18 tests from the conditional space back into TESTLIST.
* RIPng: Print the protocol name when the version is invalidFrancois-Xavier Le Bail2023-02-162-2/+3
| | | | Update the output of a test accordingly.
* CMake: improve the comment before project(tcpdump C). [skip ci]Guy Harris2023-02-151-4/+7
| | | | | | | | Note that, even if there weren't horrible consequences to either 1) having no C++ compiler, 2) setting an instruction set bit width in CFLAGS but not in CXXFLAGS, or 3) having C and C++ compilers with different default instruction set bit-widths, specifying that we're C-only avoids wasting time looking for a C++ compiler.
* Autoconf: Remove Solaris prototype headers. [skip appveyor]Denis Ovsienko2023-02-153-240/+0
| | | | | | | | | os-sunos4.h is for SunOS 4 and os-solaris2.h is for Solaris 2, which both were released about 30 years ago. However, config.guess still detects Solaris-like OSes as "solaris2", so os-solaris2.h could actually be used in .devel builds on respective OSes. However, that made no difference because tcpdump _compiles_ without the header just fine even on Solaris 9, which was released more than 20 years ago.
* Makefile.in: Update whitespacecheck target to show spaces before tabsFrancois-Xavier Le Bail2023-02-151-0/+5
|
* Fix spaces before tabs in indentationFrancois-Xavier Le Bail2023-02-1541-178/+178
|
* Include <time.h> from netdissect.h.Denis Ovsienko2023-02-152-2/+1
| | | | | | | | | | | | | | | netdissect.h since commit 7578e1c requires <time.h> for struct tm. The dependency is difficult to notice because the warning pops up when compiling strdup.c only and only on Linux, and Linux most certainly has strdup(), so normally strdup.c is never compiled on Linux. Make it correct anyway to eliminate a space for future surprises in other files. $ make strdup.o In file included from ./missing/strdup.c:38: ./netdissect.h:441:38: warning: 'struct tm' declared inside parameter list will not be visible outside of this definition or declaration gcc (Debian 10.2.1-6) 10.2.1 20210110
* Avoid a space before a tab in a commentFrancois-Xavier Le Bail2023-02-151-1/+1
| | | | | | | | | This change avoids a false positive when looking for bad indentations. Moreover: Replace the deprecated 'egrep' variant by 'grep -E'. [skip ci]
* README.haiku.md: we now require the latest Clang version. [skip ci]Guy Harris2023-02-141-1/+1
|
* configure, CMake: remove -fPIC hacks for Haiku.Guy Harris2023-02-142-59/+2
| | | | | As of llvm12_clang-12.0.1-5, Clang defaults to generating PIC, just as GCC does, and the entire matrix now works.
* doc: Update Clang in README.haiku.md. [skip ci]Denis Ovsienko2023-02-141-1/+1
|
* configure: move the addition of -fPIC to CFLAGS on Haiku earlier.Guy Harris2023-02-131-20/+23
| | | | | | Add it before doing anything about the C compiler, so that all tests done with the compiler are done with -fPIC, in case any of those tests involve producing an executable image.
* CMake: try to fix the Haiku build.Guy Harris2023-02-131-16/+37
| | | | | | | | | | | | | | | If we set CMAKE_C_FLAGS_INIT to "-fPIC" before setting the project, that initializes CMAKE_C_FLAGS to "-fPIC" *before* prepending the contents of the CFLAGS environment variable, and *before* doing any tests that depend on linking, in the project() command, so it 1) adds -fPIC before doing those tests, so they don't fail due to the object files being unfit to link into an executable, and 2) adds the contents of CFLAGS to CMAKE_C_FLAGS, so the user can set CFLAGS and have it affect the build. This requires CMake 3.7 or later, so we set 3.7 as the minimum required on Haiku. This should fix some of #996, although more needs to be done.
* configure: add -fPIC to CFLAGS, not V_CCOPT, on Haiku.Guy Harris2023-02-132-27/+20
| | | | | | | THat forces *all* uses of the C compiler, whether it's being used in configure-script tests or used to compile tcpdump, to gave -fPIC, which is necessary on Haiku in order for linking to work. Otherwise, configure script tests that involve linking will fail.
* CMake: give up on Clang on Haiku.Guy Harris2023-02-121-17/+14
| | | | | Haiku bug 18258 makes it too painful to beat the configuration process into submission.
* CMake: force -fPIC on Haiku, as we do with autotools.Guy Harris2023-02-121-0/+17
| | | | | This, and 64f81903ba4bbee414776b2884f8e88d3c9ae24f, address some of the issues in #996; in particular, they fix link errors.
* Fixup the previous commit. [skip ci]Denis Ovsienko2023-02-121-0/+1
|