Page MenuHomeFreeBSD

libpcap 1.10.6 update: diff between the vendor branch and contrib
ClosedPublic

Authored by jrm on Sat, Mar 14, 8:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 1, 5:24 PM
Unknown Object (File)
Thu, Mar 26, 9:32 AM
Unknown Object (File)
Wed, Mar 25, 1:27 PM
Unknown Object (File)
Wed, Mar 25, 12:44 AM
Unknown Object (File)
Mon, Mar 23, 6:34 AM
Unknown Object (File)
Mon, Mar 23, 6:34 AM
Unknown Object (File)
Sun, Mar 22, 7:39 PM
Unknown Object (File)
Sun, Mar 22, 3:01 AM
Subscribers

Details

Reviewers
jrm
Summary

This is the output of git diff --diff-filter=M vendor/libpcap/1.10.6 HEAD:contrib/libpcap. I will add reviewers after I annotate each diff chunk.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

jrm requested review of this revision.Sat, Mar 14, 8:40 PM

Add more context to the diff.

All the changes are now annotated. @glebius's changes to pcap-bpf.c were merged upstream in https://github.com/the-tcpdump-group/libpcap/commit/ea5317adaf0e4e308543fbd66977f89344f9ef7f, so our local changes should go away with the next pcacp update.

pcap-bpf.c
46
1724
1741
2040
2867–2940

Introduced by glebius in 94b76ea9d1367 and 88b04633c29e3.

3005

Introduced by glebius in 94b76ea9d1367.

3016
3159–3163
pcap/bpf.h
89–97

The local changes in this file were introduced in 6d1c946e916845d01062e146aad5395410da1e54. The motivation for the changes is described in this comment.

pcap/pcap.h
905

This #if 0 .. #endif block was added by hselasky in 65b806b289705 in order to "Hide unsupported remote capture definitions to avoid breakage in ports."

For not macOS, upstream's mechanism is simply this: The functions are declared in the header but not present in the library. Anyone who tries to use them gets a linker error, not a compile error. There is no compile-time protection.

I don't think the #if 0 block in pcap/pcap.h is strictly necessary. Removing it entirely would:

  • Eliminate the diff for pcap/pcap.h completely and match upstream's behaviour on non-macOS platforms.
  • Change the failure mode from a compile error (undeclared identifier 'pcap_open') to a linker error (undefined symbol: pcap_open). This is arguably clearer for developers, since the error message names the missing function.

The case for keeping #if 0 is conservative. It prevents ports from even compiling against the remote API accidentally. But that's a policy choice, not a technical requirement, and upstream makes the opposite choice.

Commited in 16cef5f7a65588def71db4fdfa961f959847e3b6.

It seems Phabricator can't handle two Differential Revision lines in a commit log. This was committed with:

Differential Revision: https://reviews.freebsd.org/D55545
Differential Revision: https://reviews.freebsd.org/D55858

Closing manually.

This revision is now accepted and ready to land.Wed, Mar 18, 6:34 PM