| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Add the required binutils-dev package.
[skip ci]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
We need space for the '\0'.
Same as in tcpslice to fix a Coverity issue.
Moreover:
Use '\0' for the null character.
|
|
|
|
|
| |
Spell patterns that are supposed to apply at the source tree root only
and remove two patterns that already appear in tests/.gitignore.
|
|
|
|
| |
HTML 3 had problems, but confusing italic for bold was not one of them.
|
| |
|
|
|
|
|
|
| |
It is not in LIBNETDISSECT_OBJ because it is optionally built.
[skip ci]
|
|
|
|
|
|
| |
They are not in LIBNETDISSECT_OBJ because they are optionally built.
[skip ci]
|
| |
|
| |
|
|
|
|
|
| |
State that these flag names became available when linking with libpcap
1.9.0 or later.
|
|
|
|
| |
Add a section for the 32-bit version.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Same as in tcpslice and libpcap.
|
|
|
|
|
|
|
| |
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".
|
|
|
|
|
| |
The last header was removed by commit
6008cb83b72a8fafe9c69f6955f4bdffbc049a09.
|
|
|
|
|
| |
We didn't completely pop the check state after we finished the checks
for libpcap.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Same as in other printers just before, since this use case is neither
the OS API nor the wire encoding,
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
That matches the descriptiions in the registry, and indicates that they
don't correspond to any AF_ values.
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
[skip ci]
|
|
|
|
| |
[skip ci]
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
(Same as in tcpslice and libpcap.)
|
|
|
|
| |
GENEVE_PORT (6081) is a destination port.
|
|
|
|
|
|
|
| |
This change decreases the execution time when the file indicating that
instrumentation is "off" exists.
[skip ci]
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Update the output of a test accordingly.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
This change avoids a false positive when looking for bad indentations.
Moreover:
Replace the deprecated 'egrep' variant by 'grep -E'.
[skip ci]
|
| |
|
|
|
|
|
| |
As of llvm12_clang-12.0.1-5, Clang defaults to generating PIC, just as
GCC does, and the entire matrix now works.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Haiku bug 18258 makes it too painful to beat the configuration process
into submission.
|
|
|
|
|
| |
This, and 64f81903ba4bbee414776b2884f8e88d3c9ae24f, address some of the
issues in #996; in particular, they fix link errors.
|
| |
|