| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
The warning/error was:
./findalldevstest.c:193:8: error: unused variable 'ipv6_buf'
[-Werror,-Wunused-variable]
char ipv6_buf[INET6_ADDRSTRLEN];
^
|
| |
|
|
|
|
| |
[skip ci]
|
| |
|
| |
|
|\
| |
| | |
Close the eventfd if we are non-blocking
|
| |
| |
| |
| |
| |
| |
| | |
The eventfd is used to break out of a poll() before it
times out, used by pcap_breakloop(). If we are non-blocking,
then the eventfd is never needed, so we close it. (And
open a new eventfd if we switch to blocking).
|
| |
| |
| |
| | |
[skip ci]
|
| |
| |
| |
| | |
[skip ci]
|
|/
|
|
|
|
|
|
|
|
| |
In Python 3 "print" is a function, not a keyword; rearrange some imports
clauses; redo the BPF expression escaping; for clarity use the full
syntax within the string template; fix and improve the dot subprocess
management; use modern HTTP server props.
This revision has been tested to work with Python 3.8, it should work
with earlier Python 3 versions as well.
|
| |
|
|
|
|
| |
The code snippet in that file is a subset of testprogs/filtertest.c.
|
|
|
|
|
| |
We haven't set EXTRA_NETWORK_LIBS in a while; no reason to keep using
it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
warnings."
This reverts commit 778f2c0e806090dc524627161bca826cc1d061a2.
Yes, Illumos (and probably Solaris) may fflush() all the standard I/O
streams before exiting, but it doesn't fclose() them, so stuff might not
be freed before exiting (but it should be accessible from stdin, stdout,
or stderr, so it's at worst a "still reachable" issue - what gives?).
There *appears* to be a suppressor for that in the Solaris valgrind, but
it doesn't seem to be working.
|
| |
|
|
|
|
|
| |
In partucular, MATRIX_CMAKE=yes subset on Solaris 10 always failed
trying to compile valgrindtest.c without <net/bpf.h>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clang 10.0.1 in OpenBSD 6.9 (on MIPS64, although not on AArch64 or
AMD64) emitted a few warnings, which on this occasion did not stand for
an issue. Squelch these anyway by switching to snprintf(). While at it,
clarify the array size using a sizeof().
/usr/bin/ld: Dwarf Error: found dwarf version '0', this reader only
handles version 2 information.
/tmp/findalldevstest-807330.o: In function `main':
findalldevstest.c:(.text+0x6ec): warning: sprintf() is often misused,
please use snprintf()
|
|
|
|
|
|
|
| |
testprogs/findalldevstest-perf uses timeradd() and timersub(), which are
available as macros in Solaris 11 via <sys/time.h> (same as in Linux,
for example), but not in earlier versions. Add the conditional
definitions to fix "make testprogs" on Solaris 10.
|
|
|
|
|
|
|
| |
This reverts commit 8b6b13d4cbb685db047af04c49817ed81fff7c35.
That solution allowed you to intermix declarations/definitions and
before the extern "C", so you can see what's being imported.
|
|
|
|
|
|
|
|
|
|
|
| |
Instead, explictly flag individual functions with extern "C" by adding
it to the tag we're already using for exported functions, and creating a
new tag to use for non-exported functions.
Rename those tags, and the tags used for exported data, to say what they
do, rather than saying "this is an API" (we may export things we don't
want to be treated as part of the API, but that we have to export
because some programs use them).
|
| |
|
|
|
|
| |
[skip ci]
|
| |
|
|\
| |
| | |
Fuzz rpcap
|
| | |
|
|/
|
|
|
|
|
| |
When dot fails to start, print a user-friendly error message instead of
dumping the stack trace. Fixup some wording here and there.
[skip ci]
|
|
|
|
|
|
| |
A bit more convenient on Windows.
Make the error reporting a bit more like tcpdump while we're at it.
|
|
|
|
|
| |
That shouldn't be necessary, but it avoids compiler warnings with older
versions of Visual Studio.
|
|
|
|
|
|
|
|
|
|
|
| |
Add a -s option to set the snapshot length; don't set it, even to a
default value, if -s isn't specified.
If there are no arguments specifying a filter, don't compile or install
a filter.
This allows us to test 1) whether the snapshot length works even if no
filter is set and 2) what happens if the snapshot length isn't set.
|
|
|
|
|
|
| |
Moreover:
Remove some spaces before tabs.
Remove an extra blank line.
|
|
|
|
|
|
|
| |
On some devices on some platforms with newer versions of libpcap,
pcap_breakloop() attempts to wake up any process blocked in a read on
the same pcap_t. Suppressing the additional wakeup attempt lets that be
tested.
|
| |
|
| |
|
|
|
|
|
| |
If no -w flag is supplied, it's not set by the argument parsing code, so
we need to initialize it to null first.
|
|
|
|
|
|
|
|
| |
This allows us to update the support for newer APIs in the future - and
in the present, with pcap_set_datalink() - and would allow Npcap to
remove its AirPcap support.
Add another test program, while we're at it.
|
| |
|
|
|
|
|
| |
It may require tweaking for UN*Xes, but it should suffice for Visual
Studio on Windows.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Have mkdep take a -s argument, giving the source directory, and have it
prepend that directory to all source files before running them through
the compiler's make-dependencies operation.
(There's more to fix, namely handling generated source files.)
|
|
|
|
|
|
| |
The right way is to look in top_srcdir, rather than assuming it's in ..
for makefiles in subdirectories; that assumption doesn't work for
out-of-tree builds.
|
|
|
| |
If the '-i' option is not used, the strdup() memory was not freed.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a pain to detect, because the PF_PACKET socket code appears to
get separate "interface went down" and "interface went away"
notifications in my "unplug a USB Wi-Fi adapter" tests on my VMware
Fusion Ubuntu 18.04 virtual machine (5.3.0 kernel), and the first
notification delivers a wakeup and returns ENETDOWN while the second
notificaiton delivers *no* wakeup and sets the ifindex member of the
struct packet_sock for the socket, so there's nothing we can test after
the wakeup that's guaranteed to indicate that the interface has
disappeared.
So what we have to do is remember the ENETDOWN but not return it as an
error, and then arrange to periodically check whether the interface is
still there; if it isn't, we *then* return the "interface went away"
error, and, if we see traffic or see that the interface is up, we clear
the remembered ENETDOWN and stop doing the periodic checks.
This is tricky, because it needs to work not only for blocking pcap_t's,
where we're in a loop doing poll() calls, so we can keep checking within
the loop, but also for non-blocking pcap_t's on which the caller is
doing select()/poll()/epoll_wait().
In order to make *that* work, we need to tweak the semantics of
pcap_get_required_select_timeout() so that it's not guaranteed that it
will always return the same value, so that it should be called within
event loops rather than called once outside the event loop. Normally,
there is no timeout required for Linux PF_PACKET sockets, but when we're
doing the periodic tests, the timeout is required.
While we're doing that, we make the return value of
pcap_get_required_select_timeout() a const pointer - there was no good
reason for the caller to modify it (it doesn't belong to the caller).
If poll() returns POLLERR, use getsockopt(SO_ERROR) to get the socket
error, rather than a read().
Update the documentation to reflect this, and make various other
cleanups (including documenting the error return value for
pcap_get_selectable_fd() to -1 rather than PCAP_ERROR - it's not an
error code, it's just a specific error value). Also note that, for
kqueues on *BSD/macOS and for select/poll on Linux, the timeout needn't
be used as a timeout for the call - you can have a timer, so that when
that *particular* timer fires, you try calling pcap_dispatch() on the
pcap_t to which it corresponds.
Update selpolltest to add more capabilities needed when testing this on
Linux.
This should address GitHub issue #859 and pull request #858.
|
|
|
|
| |
[skip ci]
|
| |
|