Date: Wed, 08 Apr 2026 23:14:45 +0000 From: Joseph Mingrone <jrm@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 150048878988 - stable/14 - ipfwpcap: Fix build after libpcap 1.10.6 update Message-ID: <69d6e165.2611e.1dd95933@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=150048878988717cd5e96718886610d6bfdaf9ac commit 150048878988717cd5e96718886610d6bfdaf9ac Author: Joseph Mingrone <jrm@FreeBSD.org> AuthorDate: 2026-03-15 05:32:01 +0000 Commit: Joseph Mingrone <jrm@FreeBSD.org> CommitDate: 2026-04-08 19:10:06 +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 (cherry picked from commit a0b3ef1952603ebf0307ca723b03e5a71598dd5a) --- 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);home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69d6e165.2611e.1dd95933>
