Closed leres closed 4 years ago
pcap-int isn't a public header, so it shouldn't include it, nor should it be including portability.h, which is also not a public header.
Instead, given that pcap files are not platform-dependent, it should define the pcap file data structures itself, as per the pcap-savefile man page or the RFC-style pcap file format specification (I plan to ask Van Jacobson and Steve McCanne if they want their names on it).
I'll do that.
I'll do that.
Done, along with a bunch of other modernizations largely stolen from modernizations done to tcpdump. It builds on my FreeBSD 11.2 VM.
pcap-int isn't a public header, so it shouldn't include it, nor should it be including portability.h, which is also not a public header.
I don't disagree with you, this was the minimal change that allowed the FreeBSD port to build without patching.
Instead, given that pcap files are not platform-dependent, it should define the pcap file data structures itself, as per the pcap-savefile man page or the RFC-style pcap file format specification (I plan to ask Van Jacobson and Steve McCanne if they want their names on it).
I don't know when dependency on pcap-int.h appeared but I just looked and it is not present in the original Network Research Group rcs repo version of search.c. There are only commits by Vern, Steve, and I ending around 2000. And I don't think we had any 64-bit systems at that point.
Rewriting the code to eliminate the dependency is clearly the best solution.
For posterity, there is now a FAQ entry about this.
or else libpcap's portability.h causes things to go off the rails.
On FreeBSD 11.3-RELEASE the conflict is with string.h: