Based on a patch from cr4ckn@sourceforge.net, but with a macro
PLURAL_SUFFIX() defined to return either "s" or "" (rather than possibly
printing a NUL character with %c), and with that macro used in a couple
of cases where the equivalent had been done by hand, and with one case
the patch missed fixed as well.
We only need to clear out the tha structure if we support IPv6, so that
the addresses are IPv6 addresses, but we only have IPv4 addresses, so
that the rest of the address bytes need to be set somehow.
Also, explain what we're doing, so people don't ask why we're not
zeroing it if we don't support IPv6.
This also fixes configure-script problems on OSes that have IPv6 support
but don't have <netinet6/in6.h> - no standard I could find requires that
header for IPv6 support (the Single UNIX Specification speaks of
<netinet/in.h> for both IPv4 and IPv6, and RFCs 2292 and 3542 don't
mention <netinet6/in6.h>, just <netinet/in.h> and <netinet6/ip6.h>).
See section 11.6 "Shell Substitutions" in the autoconf documentation,
especially the
There is just no portable way to use double-quoted strings
inside double-quoted back-quoted expressions (pfew!).
part.
Rather than hardcode the WIN32 define, add proper fork checks to the
configure script and check those. This fixes building for nommu systems
which lack the fork function.
While we're here though, add support for this functionality via vfork
so that it does work on nommu systems. And fix an old bug where we
exit properly in the forked child when the exec failed instead of just
returning to the calling code (which isn't expecting it).
Reviewed-By: Guy Harris <guy@alum.mit.edu>
The PROG variant does not take into consideration cross-compilation, so
it always looks for "pcap-config" which finds the host script. So use
the TOOL variant instead which first searches for the cross-prefixed
pcap-config before falling back to the bare "pcap-config".
Reviewed-By: Guy Harris <guy@alum.mit.edu>
After finding libpcap and getting a list of other flags needed when
linking, we check for "pcap_loop()", to make sure we found a working
libpcap and have all the right other libraries with which dnl to link.
(Otherwise, for example, the check for pcap_list_datalinks() will fail,
not because the routines are missing from the library, but because we
aren't linking properly with libpcap, and that will cause confusing
errors at build time.)
In addition to Paul's change, I added a comment explaining why we do
this, and explaining that doing so after opening the first savefile
doesn't help with subsequent savefiles, so you'll have to come up with a
better fix if you want the savefiles opened by the original UID or
outside the chroot.
Reviewed-By: Guy Harris <guy@alum.mit.edu>
This prevents GCC on SPARC from generating code that assumes those
structures are aligned naturally, which they are not guaranteed to be.
Move some #defines from interface.h to tcpdump-stdinc.h to make them
available to code that doesn't include interface.h.
Move the declaration of nextproto6_cksum() to ip6.h, so that only files
that use it get it declared, and thus so that you don't need to define
"struct ip6_hdr" in everything that includes interface.h. Don't include
ip6.h in tcpdump-stdinc.h.
We have our own copies of those include files, which we use; we haven't
used the system versions for a long time, so we don't need to drag them
along for compiling WinDump.
Don't include the win32/Include/Arpa copy in print-udp.c; don't put that
copy into the release tarball; and don't talk about <arpa/tftp.h>, or
work around its deficiencies in some OSes, as we no longer include it,
we include our own tftp.h, which has a th_stuff array in its structure
definition.