Bug 217219 - sysutils/pftop includes pcap-int.h
Summary: sysutils/pftop includes pcap-int.h
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Marcelo Araujo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-19 02:53 UTC by guy
Modified: 2017-05-26 20:07 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (araujo)


Attachments
Patch to make sysutils/pcap include pcap/pcap.h instead of pcap-int.h (681 bytes, patch)
2017-02-19 06:37 UTC, Ben Woods
woodsb02: maintainer-approval? (araujo)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description guy 2017-02-19 02:53:13 UTC
As reported in libpcap GitHub issue #560:

    https://github.com/the-tcpdump-group/libpcap/issues/560

pftop fails to build.

The problem is that 1) it's including a *libpcap-internal* header file, pcap-int.h, which FreeBSD, for some reason, apparently sees fit to install as a system header file (thus not discouraging programmers from including pcap-int.h and potentially depending on internals that are not only subject to change from release to release but that have changed *quite* a bit over time), and 2) that header file has, in fact, changed to include another *libpcap-internal* header file, portability.h.

I see nothing in any of the pftop code that even uses libpcap - it has what appears to be a private fork of libpcap's BPF compiler.  libpcap's BPF compiler source files include pcap-int.h, but that's because they're *part of libpcap* and look at some data about the pcap_t for which they're compiling code; pftop's BPF compiler doesn't even have a pcap_t to look at.

Ripping out the includes of pcap-int.h, and copying over any declarations or definitions needed for pftop, would fix this problem.
Comment 1 Ben Woods freebsd_committer 2017-02-19 06:37:53 UTC
Created attachment 180130 [details]
Patch to make sysutils/pcap include pcap/pcap.h instead of pcap-int.h

Patching the code in sysutils/pftop to include <pcap/pcap.h> instead of "pcap-int.h" or <pcap-int.h> fixes the build on 12-current.
Comment 2 Ben Woods freebsd_committer 2017-02-19 06:45:20 UTC
I have also performed runtime testing to confirm pftop still works with the patch.
Comment 3 Dimitry Andric freebsd_committer 2017-02-21 19:07:19 UTC
I just ran into the same issue while building pftop.  The patch works fine for me.
Comment 4 commit-hook freebsd_committer 2017-05-26 20:01:58 UTC
A commit references this bug:

Author: dim
Date: Fri May 26 20:01:01 UTC 2017
New revision: 441813
URL: https://svnweb.freebsd.org/changeset/ports/441813

Log:
  Fix building of sysutils/pftop on FreeBSD 12, where pcap-int.h has been
  removed.  This patches the affected files to use <pcap/pcap.h> instead.

  Submitted by:	woodsb02
  Approved by:	bapt
  PR:		217219
  MFH:		2017Q2

Changes:
  head/sysutils/pftop/Makefile