Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Mar 2026 05:37:50 +0000
From:      Joseph Mingrone <jrm@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a0b3ef195260 - main - ipfwpcap: Fix build after libpcap 1.10.6 update
Message-ID:  <69b645ae.1e97a.46de4c5f@gitrepo.freebsd.org>

index | next in thread | raw e-mail

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);


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69b645ae.1e97a.46de4c5f>