mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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)
This commit is contained in:
parent
0064d9a193
commit
81f87c4d69
1 changed files with 2 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue