From nobody Thu Feb 16 15:42:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHfMQ5F63z3qbHv; Thu, 16 Feb 2023 15:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHfMQ4dNXz3vPB; Thu, 16 Feb 2023 15:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676562130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+rkUfXKbESOvTPkhiGw3D4CqaOxQsYDZDwuAx8sbOA=; b=qc0X3lkx12zDBb67eyeqYQzLe7q1rmzR42069Z0i4ilyZzNyk4cyN8Jo021yCCyydYReVT wM/5zp8K9WOivh0kK6ayZ3gd2xHhuou6ZWW2hEAjkcnszVCQy/IJS/8hlpPayIqpL8oECs P1mGTTWTU3RHmhZOMXV4vebhMckyi6axkB0iAXm4tsvp13xEtEjf6E7Bjg6bQY6M2K86ZG pHqs5lfVnc8rBZW3I/AlwoASj3Y/+WJR9d1dXQJmV4lojSJbpcxjj2HW0fSQlH3IVd23a7 PKl5t0l9kiUBLJ+sqr3KU3pRLLGpfgCkk54YdRYlfuGrdNVtLGS2PVWs8FlqUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676562130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+rkUfXKbESOvTPkhiGw3D4CqaOxQsYDZDwuAx8sbOA=; b=tvP5N2SiftX2oOrTB7oBsKkGhDndt4HKQFBU1pgFqjrnkj4Z1SgvW0u0EwYAjGsj93yhkW 4Nj/XA7Lrg0VAb/iLttotVwTIiz8SeTotUXiuann7M1J2AHQmHVOrtrBSMJedOznKoNsYv M1tZDRtN6rSFIUS0uL99/qjAYUU9Zr0pfa85NZuwDewTy8QFYMj1JvTyGIvQElma6QSH/U Try8dyqjTmsAAFBY2Z1H29hcMaQPf37QoYHsRB2rldwMZYWXS+kEv3vQ7dWXJyGtSD53ur cvYpycqW1pyPhWKaY2ZX7d5tDvj2itHRXanRCFf3v85KErrNkXttOEQCDlqa+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676562130; a=rsa-sha256; cv=none; b=nZHTBsWWAktBHB3ESkFgHpp/X2VZNcoqf064ssxAbLYoSfaRdG1DL93zkz8GY4Awxs6Yju 2KqwxEligVwCrEFGq1zHRhFhfVVqxjPqHuknI1CUq1VO3nu1ZdoKgpTFqQIA6y0kloQZ8j s8J3UOJff1e5oCcl8A+gYLiypgfd3/f7mhN0p21FWhcqAnDH1XWnBqEigMYQkLRG92eVH0 kxAMvUwkQwXlVQQnYUrBEGXHdyaYdOBMM8JbgY346Ci27cZ7DviJNYGNliNcSXxKJAnAlY df2+bMW0H+1umz/NnvH7u8Mej+gC4wY1aHoOp/sESiZ4Hnc7yNSPi4L/VAS4iA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHfMQ3N1Mz18NN; Thu, 16 Feb 2023 15:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31GFgAad084326; Thu, 16 Feb 2023 15:42:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GFgAFu084325; Thu, 16 Feb 2023 15:42:10 GMT (envelope-from git) Date: Thu, 16 Feb 2023 15:42:10 GMT Message-Id: <202302161542.31GFgAFu084325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 6d1c946e9168 - main - libpcap: Make pcap/bpf.h a wrapper around system net/bpf.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d1c946e916845d01062e146aad5395410da1e54 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrm (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6d1c946e916845d01062e146aad5395410da1e54 commit 6d1c946e916845d01062e146aad5395410da1e54 Author: Joseph Mingrone AuthorDate: 2023-02-13 22:06:51 +0000 Commit: Joseph Mingrone CommitDate: 2023-02-16 15:37:51 +0000 libpcap: Make pcap/bpf.h a wrapper around system net/bpf.h In the past, we modified pcap/pcap.h to include the system net/bpf.h rather than libpcap's own pcap/bpf.h. However, starting around 1.10.2, libpcap requires a few extern functions defined in pcap/bpf.h to build. Simply reverting that local change and pulling in pcap/bpf.h is not a solution, because some ports with '#include ' such as mail/spamd and net/xprobe require the system net/bpf.h to be pulled in. To accommodate both requirements, make pcap/bpf.h a wrapper around the system net/bpf.h, but retain the extern function definitions. This is in preparation for libpcap 1.10.3. Approved by: cy, philip, emaste, delphij (earlier revision) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38575 --- contrib/libpcap/pcap/bpf.h | 16 ++++++++++++++++ contrib/libpcap/pcap/pcap.h | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/contrib/libpcap/pcap/bpf.h b/contrib/libpcap/pcap/bpf.h index 9d748952a0e5..1c9d0f56a01a 100644 --- a/contrib/libpcap/pcap/bpf.h +++ b/contrib/libpcap/pcap/bpf.h @@ -74,6 +74,18 @@ extern "C" { #endif +/* + * In the past, we modified pcap/pcap.h to include the system net/bpf.h, + * rather than this file. However, starting around 1.10.2, libpcap requires + * the extern functions defined here to build. Simply reverting that local + * change is not a solution, because some ports with '#include ' + * such as mail/spamd and net/xprobe require the system net/bpf.h to be + * pulled in. To accommodate both requirements, make this header a wrapper + * around the system net/bpf.h, but keep the extern function definitions. + */ +#if defined(__FreeBSD__) +#include +#else /* BSD style release date */ #define BPF_RELEASE 199606 @@ -244,13 +256,17 @@ struct bpf_insn { #define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } #define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } +#endif /* defined(__FreeBSD__) */ + PCAP_API int bpf_validate(const struct bpf_insn *, int); PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); +#if !defined(__FreeBSD__) /* * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). */ #define BPF_MEMWORDS 16 +#endif #ifdef __cplusplus } diff --git a/contrib/libpcap/pcap/pcap.h b/contrib/libpcap/pcap/pcap.h index a2d6003cdf61..4e30e77812ef 100644 --- a/contrib/libpcap/pcap/pcap.h +++ b/contrib/libpcap/pcap/pcap.h @@ -85,7 +85,10 @@ #endif /* _WIN32/MSDOS/UN*X */ #include /* for SOCKET, as the active-mode rpcap APIs use it */ -#include + +#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H +#include +#endif #include