git: a0b3ef195260 - main - ipfwpcap: Fix build after libpcap 1.10.6 update
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 15 Mar 2026 05:37:50 UTC
The branch main has been updated by jrm:
URL: https://cgit.FreeBSD.org/src/commit/?id=a0b3ef1952603ebf0307ca723b03e5a71598dd5a
commit a0b3ef1952603ebf0307ca723b03e5a71598dd5a
Author: Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2026-03-15 05:32:01 +0000
Commit: Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2026-03-15 05:32:01 +0000
ipfwpcap: Fix build after libpcap 1.10.6 update
pcap-int.h now references SIZEOF_TIME_T from libpcap's config.h, which
is not available to consumers of the internal header outside of the
libpcap build. Switch to the public <pcap.h> header and replace the
direct FILE* casts and ferror()/fflush() calls with pcap_dump_flush(3),
which is the correct public API for flushing a pcap dump file.
Sponsored by: The FreeBSD Foundation
---
usr.sbin/ipfwpcap/ipfwpcap.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/usr.sbin/ipfwpcap/ipfwpcap.c b/usr.sbin/ipfwpcap/ipfwpcap.c
index a9cead99bd07..2032387aaa0b 100644
--- a/usr.sbin/ipfwpcap/ipfwpcap.c
+++ b/usr.sbin/ipfwpcap/ipfwpcap.c
@@ -41,11 +41,7 @@
#include <net/bpf.h>
-/* XXX normally defined in config.h */
-#define HAVE_STRLCPY 1
-#define HAVE_SNPRINTF 1
-#define HAVE_VSNPRINTF 1
-#include <pcap-int.h> /* see pcap(3) and /usr/src/contrib/libpcap/. */
+#include <pcap.h>
#ifdef IP_MAXPACKET
#define BUFMAX IP_MAXPACKET
@@ -295,8 +291,7 @@ if (debug) fprintf(stderr, " sendto(%d) = %d\n", sd, r);
(void) gettimeofday(&(phd.ts), NULL);
phd.caplen = phd.len = nr;
pcap_dump((u_char *)dp, &phd, buf);
- if (ferror((FILE *)dp)) { perror(dumpf); quit(14); }
- (void) fflush((FILE *)dp);
+ if (pcap_dump_flush(dp) == -1) { pcap_perror(p, dumpf); quit(14); }
}
quit(0);