aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | | airpcap: format an error message if we run out of memory.Guy Harris2023-06-241-1/+4
| | | | | | | | | | | | | | | | | | If we can't allocate the list of DLT_ values, format a message; if PCAP_ERROR is returned, the caller will expect pcap_geterr() to return a pointer to an appropriate error message.
* | | haiku: no need to supply a list of DLT_s.Guy Harris2023-06-241-7/+17
| | | | | | | | | | | | | | | | | | If you have only one DLT_ per interface, you don't need to construct a list containing that DLT_; pcap_list_datalinks() will construct a one-element list containing that DLT_ and provide it to the caller.
* | | linux: only use DLT_LINUX_SLL2 for the "any" device.Guy Harris2023-06-241-22/+10
| | | | | | | | | | | | | | | | | | | | | The only thing DLT_LINUX_SLL2 adds is the interface index and, if we're falling back on cooked captures just because we don't have a DLT_ to which to map the ARPHRD_ type, we're capturing on a single device and the interface index adds no additional information.
* | | linux: fix code path to properly return warnings.Guy Harris2023-06-241-64/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't overwrite PCAP_WARNING_ codes with 0 (success). While we're at it, clean up some leftovers from when we supported older Linux kernels and failures to, for example, set up PF_PACKET sockets or to set up a memory-mapped buffer meant "fall back on older mechanisms" rather than "fail".
* | | diffs: fix up the "warn about the fallback to a cooked socket" message.Guy Harris2023-06-241-6/+1
| | | | | | | | | | | | | | | | | | Only test for "I don't know what DLT to map this ARPHRD to" case once and, if we don't know that, set the error message and arrange that we return PCAP_WARNING.
* | | Cirrus CI: Disable the unused Windows taskFrancois-Xavier Le Bail2023-06-211-7/+7
| | | | | | | | | | | | [skip ci]
* | | Fix a typo in pcap-savefile.manfile.in. [skip ci]Denis Ovsienko2023-06-141-3/+3
| | | | | | | | | | | | Set the date stamp appropriately while at it.
* | | pcap-filter(7): Update the timestampFrancois-Xavier Le Bail2023-06-141-1/+1
| | | | | | | | | | | | [skip ci]
* | | Add the Solaris "any" device in pcap_findalldevs() if we have it.Guy Harris2023-06-137-11/+75
| | | | | | | | | | | | | | | | | | | | | | | | There's no good run-time test, so we test at configure time, by checking whether /usr/include/inet/ipnet.h exists and contains IPNET_ANY_LINK. See https://github.com/the-tcpdump-group/tcpdump/issues/1057#issuecomment-1584088911 We make a common routine to use to add that device.
* | | bpf: handle Solaris returning ESRCH for "no such device".Guy Harris2023-06-131-0/+12
| | | | | | | | | | | | | | | Thanks for changing the error code, and thanks for promptly telling us that you did so!
* | | pcap-filter(7): Add the filter "ifindex interface_index"Francois-Xavier Le Bail2023-06-131-0/+7
| | | | | | | | | | | | [skip ci]
* | | appveyor: unpack the Npcap SDK into a directory without the SDK version.Guy Harris2023-06-071-9/+9
| | | | | | | | | | | | | | | | | | No need for the SDK to be unpacked into a directory whose name contains the SDK version; leaving the SDK version reduces the number of places you have to change if you go to a newversion of the SDK.
* | | appveyor: we're installing the 1.13 Npcap SDK, use it, not the 1.12 SDK.Guy Harris2023-06-071-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | One advantage of d7f44c5f8328a3979286ed2715f900a3a556001f is that it revealed that we were installing the 1.13 Npcap SDK and trying to configure with the 1.12 SDK; now that doing so fails, the build fails. Fix that, so we use the same SDK as we install.
* | | Fail if packet capture support cannot be found.Guy Harris2023-06-072-16/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, tell the user that they need to install Npcap or WinPcap, and the respective SDK, and tell CMake where the SDK is located. On UN*X, tell them to check INSTALL.md. In addition, tell the user to set the capture type to "null" when configuring if they just want a version of libpcap that can read capture files but can't do live captures. That way, the user won't be surprised at run time by a libpcap that fails with "live packet capture not supported on this system" if they try to capture traffic. Fixes #1016 (in the sense that configuration stops if a capture mechanism can't be found, and tells the user what they need to do).
* | | gencode: Remove an assignment after a bpf_error() callFrancois-Xavier Le Bail2023-06-041-1/+0
| | | | | | | | | | | | | | | | | | Reminder: bpf_error() do a longjmp(). This change should fix Coverity CID 1529951.
* | | Cirrus CI: Avoid perl warnings about setting locale, Coverity taskFrancois-Xavier Le Bail2023-06-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warnings were like: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C").
* | | Use %zu as the print format for size_tFrancois-Xavier Le Bail2023-06-031-1/+1
| | |
* | | Add a change log for the previous commit. [skip ci]Denis Ovsienko2023-06-021-0/+1
| | |
* | | Jump to "quit" label if scanner cannot be initializedRose2023-06-011-6/+10
| | | | | | | | | | | | | | | | | | With the current behavior, we log the error, but try to scan the string anyway. We need to quit if the scanner cannot be initialized.
* | | Makefile.in: Update the whitespacecheck targetFrancois-Xavier Le Bail2023-06-011-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | install-sh has no longer a tab at the end of one line. This is a follow-up to b46c2cfc9a1968e61d628ce03b2d919a1136013f. diff --git a/Makefile.in b/Makefile.in index cd0f01c3..80f5bc82 100644 --- a/Makefile.in +++ b/Makefile.in @@ -546,8 +546,7 @@ whitespacecheck: exit 1; \ fi @# trailing tab(s)? - @# install-sh has a tab at the end of one line - @if git grep -I -n ' $$' $$(git ls-files|grep -vE '^(tests/|install-sh$$)'); then \ + @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); then \ echo 'Error: Trailing tabs(s).'; \ exit 1; \ fi .
* | | Update CHANGES for the previous commit. [skip ci]Denis Ovsienko2023-05-311-0/+1
| | |
* | | Update install-sh script to the latest available versionRose2023-05-311-199/+490
| | | | | | | | | | | | | | | | | | | | | | | | The version of install-sh we have was made over 2 decades ago, and last edited 9 years ago. I updated the script by running autoreconf -fiv on autoconf 2.71, and autoreconf automatically updated the script.
* | | Merge pull request #1194 from guyharris/make-atexit-happyGuy Harris2023-05-301-1/+14
|\ \ \ | | | | | | | | Add a routine to use as an atexit() routine to clean up Winsock 2.
| * | | Add a routine to use as an atexit() routine to clean up Winsock 2.Guy Harris2023-05-301-1/+14
|/ / / | | | | | | | | | | | | | | | | | | | | | Wrap WSACleanup() in a routine that calls it but returns nothing, so that the wrapper has the right type for an atexit() routine. This is cleaner that casting a pointer to WSACleanup(), and should avoid warnings from VS 2022.
* | | findalldevstest: Print also Address Family numericallyFrancois-Xavier Le Bail2023-05-271-2/+2
| | |
* | | Rename doc/README.Win32.md to doc/README.windows.md.Guy Harris2023-05-263-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives it a name similar to the other README.{operatingsystem} files. It also reflects that 1) 16-bit Windows is now so old and tired that there's no need to use a name that specifically mentions a non-16-bit version of Windows to indicates that we don't support it and 2) there's now 64-bit Windows, so "Win32" is an out-of-date name.
* | | Prefix routines declared in pcap-int.h with pcap_.Guy Harris2023-05-2635-98/+98
| | | | | | | | | | | | | | | This avoids potential and, in one case (SIMH), actual collisions with names in other libraries or in applications using libpcap.
* | | CI: Test with IPv6 support enabled/disabledFrancois-Xavier Le Bail2023-05-232-17/+23
| | |
* | | pcap savefile: Use Reserved1 and Reserved2 in the per-file headerFrancois-Xavier Le Bail2023-05-234-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | This part is in line with the draft-ietf-opsawg-pcap. Moreover: Update some comments. Update pcap-sita.html.
* | | Revert "pcap: Update the per-file header to use reserved1 and reserved2"Francois-Xavier Le Bail2023-05-234-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c2dfd817646d071bf62a3968a0454301e5395d18. From a Denis remark: struct pcap_file_header is in a public header. pcap-savefile.manfile.in will be updated separately.
* | | findalldevstest: Avoid warning/error when IPv6 is not enableFrancois-Xavier Le Bail2023-05-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The warning/error was: ./findalldevstest.c:193:8: error: unused variable 'ipv6_buf' [-Werror,-Wunused-variable] char ipv6_buf[INET6_ADDRSTRLEN]; ^
* | | pcap: Update the per-file header to use reserved1 and reserved2Francois-Xavier Le Bail2023-05-204-16/+18
| | | | | | | | | | | | | | | | | | Update pcap-savefile.manfile.in accordingly. This is in line with the draft-ietf-opsawg-pcap.
* | | struct pcap: Update buffer type from "void *" to "u_char *"Francois-Xavier Le Bail2023-05-1817-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change should avoid these cppcheck warnings: pcap-hurd.c:77:18: warning: 'p->buffer' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] pkt = p->buffer + offsetof(struct net_rcv_msg, packet) ^ pcap-hurd.c:78:8: warning: 'p->buffer+offsetof(struct net_rcv_msg,packet)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] + sizeof(struct packet_header) - ETH_HLEN; ^ pcap-hurd.c:79:25: warning: 'p->buffer' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] memmove(pkt, p->buffer + offsetof(struct net_rcv_msg, header), ^ Remove some '(u_char *)' casts accordingly.
* | | Remove unused variable retval in sock_present2networkRose2023-05-161-2/+1
| | | | | | | | | | | | This quiets the compiler since it is not even returned anyway, and is a misleading variable name.
* | | Set the date right in pcap-config(1). [skip ci]Denis Ovsienko2023-05-141-1/+1
| | |
* | | Merge pull request #1165 from nmap/npcap-1.00-bug-workaroundGuy Harris2023-05-091-38/+44
|\ \ \ | | | | | | | | Work around a bug in Npcap 1.00 in case of driver version mismatch
| * | | Work around a bug in Npcap 1.00 in case of driver version mismatchDaniel Miller2023-03-221-38/+44
| | | |
* | | | Merge pull request #1180 from AtariDreams/strGuy Harris2023-05-093-5/+5
|\ \ \ \ | | | | | | | | | | Use the intended date types for variables passed as or compared to other types
| * | | | Use the intended date types for variables passed as or compared to other types.Rose2023-05-083-5/+5
| | | | |
* | | | | Merge pull request #1182 from guyharris/werror-with-newer-clangGuy Harris2023-05-081-5/+0
|\ \ \ \ \ | | | | | | | | | | | | build.sh: remove the check for Clang 15 and 16.
| * | | | | build.sh: remove the check for Clang 15 and 16.Guy Harris2023-05-081-5/+0
|/ / / / / | | | | | | | | | | | | | | | | | | | | We're working around the warning they produce for yynerrs in the parser being set but not used.
* | | | | Merge pull request #1181 from guyharris/squelch-annoyig-warningGuy Harris2023-05-081-0/+8
|\ \ \ \ \ | |/ / / / |/| | | | compiler: squelch set-but-not-used warning for yynerrs.
| * | | | compiler: squelch set-but-not-used warning for yynerrs.Guy Harris2023-05-081-0/+8
|/ / / /
* | | | Cirrus CI: Don't try Valgrind on Linux. [skip appveyor]Denis Ovsienko2023-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Valgrind does not like binaries produced by Clang 15: $ valgrind --leak-check=full --error-exitcode=1 testprogs/findalldevstest ==23242== Memcheck, a memory error detector ==23242== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==23242== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info ==23242== Command: testprogs/findalldevstest ==23242== ==23242== Valgrind: debuginfo reader: ensure_valid failed: ==23242== Valgrind: during call to ML_(img_get) ==23242== Valgrind: request for range [70669806, +4) exceeds ==23242== Valgrind: valid image size of 1078392 for image: ==23242== Valgrind: "/tmp/cirrus-ci-build/testprogs/findalldevstest" ==23242== ==23242== Valgrind: debuginfo reader: Possibly corrupted debuginfo file. ==23242== Valgrind: I can't recover. Giving up. Sorry.
* | | | Merge pull request #1179 from guyharris/dont-need-that-any-moreGuy Harris2023-05-081-6/+16
|\ \ \ \ | | | | | | | | | | compiler: limit some Berkeley YACC workarounds to pre-2017-07-09 releases.
| * | | | compiler: limit some Berkeley YACC workarounds to pre-2017-07-09 releases.Guy Harris2023-05-081-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Those later releases only define yydebug if YYDEBUG is defined and only declare yynerrs as global for non-reentrant parsers, so limit the workarounds for those problems to releases before the 1.9 20170709 release.
* | | | | Cirrus CI: Bump a few versions up. [skip appveyor]Denis Ovsienko2023-05-081-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to FreeBSD 13.2 and size it down as in tcpdump much earlier. Switch Clang to 15 in FreeBSD and Linux (for some reason there was no pkg error in this project, but it makes sense to upgrade consistently anyway).
* | | | | Revert "Makefile.in: Build libpcap before the testprogs in releasecheck target"Francois-Xavier Le Bail2023-05-081-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c7f7036094bf9c48fdfa803085857a35753e938f. This is a follow-up to 5e6aead918140299fd5b12c74dd4c728732ab47d.
* | | | | Makefile.in: Build libpcap before the testprogsFrancois-Xavier Le Bail2023-05-081-1/+1
| | | | |
* | | | | Makefile.in: Build libpcap before the testprogs in releasecheck targetFrancois-Xavier Le Bail2023-05-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should avoid, with autotools, when doing parallel builds: make[2]: *** No rule to make target '../libpcap.a', needed by 'valgrindtest'. Stop.