| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
--with-system-libpcap didn't work - it didn't prevent searching for a
local libpcap - and had a misleading name. Replace it with
--disable-local-libpcap.
This should address GitHub issue #823.
|
|
|
|
| |
(In devel mode)
|
|
|
|
|
| |
Not currently a problem for tcpdump, as we have no subdirectories, but
this will leave us prepared for subdirectories if we ever add any.
|
|
|
|
|
|
|
|
|
|
|
| |
I can't seem to make those issues pop up on my (x86-64) machine, and, if
they do show up on any platforms, the best hack to handle it is probably
to have a special tcpdump flag to force it to do a floating-point
calculation and see what result is generated, and report the result, so
we know what it'll do with the numbers in the test files, and have
tests/TESTrun run tcpdump with that flag.
If those tests *do* fail, we'll know what calculations to do.
|
| |
|
|
|
|
| |
[skip ci]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we have pkg-config, *and* it has .pc files for libpcap, use it to get
the C compiler flags and linker flags for libpcap.
find_library() sets a cache variable; when we're looping over libraries,
trying to find their full paths, we really want the variable to act as a
local variable, as we're looking up different libraries, so unset it
after we're finished processing a particular library.
When we're searching for static libraries, save the current value of
CMAKE_FIND_LIBRARY_SUFFIXES, set it to ".a", and then restore it when
we're done. Don't use cmake_push_check_state() for that, as
CMAKE_FIND_LIBRARY_SUFFIXES is *not* one of the variables that it's
guaranteed to save and restore.
|
| |
|
|
|
|
|
| |
We now allow them, and require a compiler that supports them, so there's
no need to warn about them.
|
| |
|
|
|
|
| |
[skip ci]
|
| |
|
| |
|
|
|
|
| |
We weren't doing so if we found a local pcap-config script.
|
| |
|
|
|
|
|
|
|
|
|
| |
Instead, use compiler test macros to check whether *particular*
attributes are supported, and set various #defines appropriately, in
header files.
Rename the UNALIGNED structure attribute to ND_UNALIGNED, and ask
whether we still need it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have four possibilities:
1) local library, with a pcap-config;
2) local library, without a pcap-config;
3) installed library, with a pcap-config;
4) installed library, without a pcap-config.
If we have a local library, i.e. one in ../libpcap{whatever}, we:
add -I flags to the C compiler flags to point it at whatever
directories in ../libpcap{whatever};
add ../libpcap{whatever}/libpcap.a to $LIBS and:
if it has a pcap-config, we use it, with --additional-libraries,
to find the additional libraries with which we need to link;
otherwise, we do the usual OS-dependent hacks to try to figure
out with what additional flags we need to link;
and add them to $LIBS after libpcap.a.
If we have an installed library:
if it has a pcap-config we use it, with --cflags, to find what flags
to add to the C compiler flags, and use it, with --libs, to see what
flags to add to $LIBS;
if it doesn't have a pcap-config, we search for -lpcap and, if that
succeeds, we assume the headers are under /usr/local/include or
/usr/include, search for them there, and, if we don't find pcap.h
there, we look for it in a pcap subdirectory under there, and add
the appropriate -I flag to the C compiler flags, and then do the
usual OS-dependent hacks to try to figure out with what additional
flags we need to link.
While we're at it, we do the libdlpi check only on Solaris, as part of
"the usual OS-dependent hacks".
|
| |
|
| |
|
|
|
|
|
| |
Don't test at configure time; that doesn't work when cross-compiling and
may be a pain to do with CMake.
|
|
|
|
|
|
|
|
|
| |
Some time between the mid 1980's and 1990 called; they want their
old-fashioned UNIX signal handling back. ANSI C has had signal handlers
returning void sincer, well, 1989, and POSIX has had sigaction() since
close to forever. No need to worry about really old UN*Xes here.
On Windows, it's also void (as per ANSI C); use signal().
|
|
|
|
| |
We don't care whether struct sockaddr has an sa_len field or not.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Handle attributes for function pointers the same way we handle
attributes for functions, by explicitly checking for the compiler
version with #if rather than with a configure script check. That's one
fewer thing that, if you're not using autoconf, has to be done in some
other fashion.
While we're at it, put NORETURN in the right place to have it work with
Microsoft Visual Studio as well as various UN*X compilers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The documentation claims that recent GCC is now better by default at
spotting cases of code flow falling through (which is true) and that it
avoids false positives by matching nearby source code comments with
regexps. However, the latter feature doesn't seem to work as reliably
as the manual describes it, so let's have a macro for this purpose.
Tested to work on:
* x86_64, Fedora 26, GCC 7.1.1 (w/__attribute__, w/fallthrough)
* x86_64, Ubuntu 16.04, GCC 5.4.0 (w/__attribute__, w/o fallthrough)
* x86_64, FreeBSD 11.0, CLang 3.8.0 (w/__attribute__, w/o fallthrough)
* SPARC, Solaris 10, SolStudio 12.4 (w/__attribute__, w/o fallthrough)
* SPARC, Solaris 10, SunStudio 11 (w/o __attribute__)
|
|
|
|
|
|
| |
Provide better detailed guidelines in CONTRIBUTING and update a number
of other files to refer to that file so that the directions are now
more uniform.
|
|
|
|
|
|
|
|
| |
Avoid 'Undefined symbol _mcount' with some Solaris compilers.
The '-pedantic' option is unknown to the comiler, but by coincidence
starts with a '-p' (gather performance data). When a file is compiled
with '-p' but is linked without '-p', 'Undefined symbol _mcount' occurs.
|
|
|
|
| |
f.e. clang version 3.4 support this warning option.
|
|
|
|
|
|
| |
Thank you, clang, for treating unknown -f flags as warnings, only
failing with them if run with -Werror, and spewing out warning messages
whenever they're used.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Have our own routines to convert between IPv4/IPv6 addresses and
strings; that helps if, for example, we want to build binary versions of
tcpdump for Windows that can run both on NT 5 (W2K/WXP), which doesn't
have inet_ntop() or inet_pton(), and NT 6 (Vista/7/8/10), which do. It
also means that we don't require IPv6 library support on UN*X to print
addresses (if somebody wants to build tcpdump for older UN*Xes lacking
IPv6 support in the system library or in add-on libraries).
Get rid of files in the missing directory that we don't need, and
various no-longer-necessary autoconf tests.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Revert "Simplify AC_LBL_CHECK_COMPILER_OPT a bit."
(commit 43e88cd5b8e9d9d643bbad585743123492452041)
The problem shows itself because 'configure' displays
"checking whether the compiler supports the -Wstrict-prototypes option... no"
even if '-Wstrict-prototypes' option is supported.
Moreover:
Update configure accordingly.
Fix a trailing space.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That let me find what might have been the bulk of the 579(!) instances
of "Deconst" reported in
http://www.cl.cam.ac.uk/~dc552/papers/asplos15-memory-safe-c.pdf
and, hopefully, will prevent more from creeping in.
There are some remaining ones - and they represent attempts to overwrite
the packet bytes handed to tcpdump by libpcap, which could well *fail*
with, for example, memory-mapped capture mechanisms!
|
|
|
|
|
|
|
|
|
| |
It was doing some of the function checks; move the remaining ones out of
AC_LBL_LIBPCAP(), which is now solely responsible for finding libpcap,
making sure it'll work, and setting compiler and linker flags
appropriately. Checks for functions that were introduced in later
versions of libpcap, which we use if available, are all done in
configure.in.
|
|
|
|
|
|
|
|
|
|
| |
Don't force the local libpcap build when the system provides one. When
--with-system-pcap is given to configure, don't try to locate a local libpcap
build. This help build systems like Buildroot that store build trees in the
same directory, but still prefer dynamically linking against system wide
libpcap.so to save space.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
|
|
|
| |
to find a libpcap that is adjacent to it, also built out of source tree
|
| |
|
|
|
|
|
|
|
| |
Fixes GitHub issue #390.
Also, if all we do when checking for a function is set a HAVE_XXX
AC_CHECK_FUNC, as AC_CHECK_FUNCS will set the #define for you.
|
| |
|
|
|
|
|
|
|
|
|
| |
And, as we require at least autoconf 2.61, and as autoconf 2.61 and
later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to
define the uintN_t and intN_t macros if the system doesn't define them
for us.
This lets us get rid of bitypes.h as well.
|
|
|
|
|
|
| |
Remove lots of $Header's and a few $Id's that all belong to the former
CVS repository of tcpdump itself. These keywords have been frozen since
the migration to git in late 2008.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we're requiring autoconf 2.61 or later, AC_PROG_CC sets -g
along with -O2 for GCC-like compilers regardless of whether .devel is
present. Add "include debugging symbols" options for MIPS C/DEC C
regardless of whether .devel is present; that's -g3, which is the
version that doesn't turn optimization off (we also turn on -O).
Also, don't change the ABI on IRIX depending on .devel.
I'm not sure why we were doing that; if somebody has a good reason to
continue doing it, please let us know what it is.
Expand some comments while we're at it.
|
| |
|
| |
|