From nobody Mon Jun 17 04:03:28 2024 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 4W2bpT1pQ4z5NC8r; Mon, 17 Jun 2024 04:03:29 +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 4W2bpT0pN0z4qtx; Mon, 17 Jun 2024 04:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718597009; 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=YNkoqzafjjLAZlCJlsqXnZZrg58awwvb1c7IjFzQbYw=; b=cvMLBs+5Jw0vOifXZVLmk/i8ECy85bXw3640wsqWZdHg/Wv1bOLpiRz2/Qo+H5u200KKqa ZCHFJPZlPnez9pV+hNqArpicCi+f7TN4x5YNVMqXIQRD2Qpu+hyJglRM4KMFKlv77phFem BBk6UQ0JjvKUASFL7u3ZdWZzxLS868xa5jGXlAsO7dV9ISzuv4EU3A273jXyBx2IrIL3m2 gRurhJ8rMEf48/no6kGRh2HINNcitVFXMim61xuXQcbkKn7jf0NxWgZqTJuR8/tu1xFDx6 7tOSAnyBz4/avA9LfK//iJ1ad32anDRmaJHYnWAt2iK+l8WzQKzOPWccxkq0yA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718597009; a=rsa-sha256; cv=none; b=vq84zWMSeF3407Lf0nV4G4OlZuRaA2SQVcUI9HO/ncG3mQAyP7mhVlUSw//73br4N7y9mS jkuj88q8cHVlxthUj3IZjLFk6KYqfg+3XfB/xGdUcnSPGfgNPJThFaB+bBBZ4ivqzx41Vl GgDQUB8gddvWRN2Ys2CmWo6jmGt3JVqvcCBhldMOEFPKgG6GjMj/FbUCQ0FECug7XkHSgK NFbqNpAxRAQOv3VViChszUZxEfbet9Ft2tLY1UhnPtIHpjFHyjmQ18L4K8fBbWfPQnfG6p aK7SOp/E2Tkd5arQy37ftxouv0FZuuqYwInWlX1TGIgO/W8TMFrD5Wljj9uk7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718597009; 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=YNkoqzafjjLAZlCJlsqXnZZrg58awwvb1c7IjFzQbYw=; b=Ci5oVtZIfzwq0dnIny6WnI5KUGISIg2ZYc1mslVYimWKCrAo5orzCczYnxU+Hnw8UOwbm/ gxZPzc0FFnWwRAKUaBUs/sOUVgY0sXYOIWHmk4lkziaPt24qcGYi1d/AHysdgRxv2pwhDi jx+XYTcc8wfN/L7Qu5CI1ShN0eRTmS1j8M7MrM8tI3dWiT8Wpze0mrYaoSVGUSM/yAA+2y sTCebosLy+daS5kG2x4hJkMrXOOx9H9tgDXx750AYvWrqn3DFu3nJNc9PLEbTy1xZvd/d6 I0JArwN0QOctOW+fSka3nEGPiF0G7EIs6YynUFL21HAA572JFzMaa70F9PHTmA== 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 4W2bpT0PtLz1Ft3; Mon, 17 Jun 2024 04:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45H43STw039658; Mon, 17 Jun 2024 04:03:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45H43S08039655; Mon, 17 Jun 2024 04:03:28 GMT (envelope-from git) Date: Mon, 17 Jun 2024 04:03:28 GMT Message-Id: <202406170403.45H43S08039655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 6ad2e347fcf8 - stable/14 - bpf: Make bpf_peers_present a boolean inline function 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ad2e347fcf8fa6aa9ebd84cfa4c71a1af90b4dd Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6ad2e347fcf8fa6aa9ebd84cfa4c71a1af90b4dd commit 6ad2e347fcf8fa6aa9ebd84cfa4c71a1af90b4dd Author: Zhenlei Huang AuthorDate: 2024-06-07 15:06:08 +0000 Commit: Zhenlei Huang CommitDate: 2024-06-17 03:59:29 +0000 bpf: Make bpf_peers_present a boolean inline function This function was introduced in commit [1] and is actually used as a boolean function although it was not defined as so. No functional change intended. 1. 16d878cc99ef Fix the following bpf(4) race condition which can result in a panic Reviewed by: markj, kp, #network MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45509 (cherry picked from commit 0dfd11abc4bd0dcb96a6d287cc4e52e8f59b64c1) --- sys/net/bpf.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/net/bpf.h b/sys/net/bpf.h index 924dea5fc9f4..7b76129aec94 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -435,15 +435,13 @@ int bpf_get_bp_params(struct bpf_if *, u_int *, u_int *); void bpfilterattach(int); u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int); -static __inline int +static __inline bool bpf_peers_present(struct bpf_if *bpf) { struct bpf_if_ext *ext; ext = (struct bpf_if_ext *)bpf; - if (!CK_LIST_EMPTY(&ext->bif_dlist)) - return (1); - return (0); + return (!CK_LIST_EMPTY(&ext->bif_dlist)); } #define BPF_TAP(_ifp,_pkt,_pktlen) \