[From upstream tcpdump]
In pcap_compile(), first check whether the pcap_t is activated.
Before we allocate or otherwise set up anything, check whether the
pcap_t is activated, and set the error message string and return -1 if
it's not.
That way, we don't go through the cleanup code in that code path -
there's nothing to clean up.
Fixes the issue in GitHub pull request #552.
XXX: pullup-8
1. include <net/dlt.h> where needed since we have the information in a separate
file.
2. #error in pcap/bpf.h to make sure it is not being used.
3. If we don't include <pcap/bpf.h> include <net/bpf.h> instead.
4. Install symlinks instead of copies of files.