From nobody Fri Jun 7 15:07:35 2024 X-Original-To: dev-commits-src-main@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 4Vwl1M5B6Vz5Nf4W; Fri, 07 Jun 2024 15:07:35 +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 4Vwl1M4Ld9z4gZR; Fri, 7 Jun 2024 15:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717772855; 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=wWpmGtHT9V3+10yPCanzgynXUxr5m8NTyuiGEkAwlEg=; b=a3HIG1XP+H2piQ5tIQaQ/T8dks5GiJU5Z2y/bO3k5Z7VWlw1YAPPRZ0c9yYBGUZ9Bw8eEK WAaGdKF3vT59kIHd/pii5KGjPwRtkrBdLEnRhQATMwFSJ1Jx50jqxFqpmTvoxBoADekL2A I3wXmgN11dLf5SOxkRGUbW+Ks5jXt+s274b3Yf5WTCjMPNMY/sOfjYEapCSrD7W9WVpE/a u+uPcm/0WQnKv4GVcITB6CwrVidRL+Q1tUcPDOsn3TwG6PSSKXZqzkZ8uzPEndYtzcIq6h RGnrQVqsbLWKrvPe2hZAcWLlgUxBfcXACf1y0NV2gNKrHOV8HjUDuwac0fzHpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717772855; a=rsa-sha256; cv=none; b=LOop21eut4MiL0fnKSVInvtSDdPbOKJf+1igcoyFfpaQssLfWQ6ninlmnDee7avyNXDPaL zdSJeqYAWHK/KeRteBQ99GgffvOJaO4ZRIGg8P9RmCBS1hLV9j6SeY1SQWy00zZwYwPH93 xFcHcJ9DDdTIrfiAaKPll4SgpWAqV9dZ097BrKg0xdiHEgPGH7vzqsFQUCpR0gEFJ4nBDe Um1UqubQx75V8XLQ38f6sp8Q22dceKLN+cvd3AM+REDpFH+HI0bQY04UaacJYdmeJDK/nU CEDI/6dVNULc/juPpd2sd0aYk/7kX4amWobVijojqddt6/cnLcbd3wuQG9pvkA== 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=1717772855; 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=wWpmGtHT9V3+10yPCanzgynXUxr5m8NTyuiGEkAwlEg=; b=YGsXufYOMOzw3SU1Z4fA3td8qTjIrEeFXED+uZKM6b70r5+9qqdTQHfLNn9U9/H3jU/iW8 UD5IojOKJnkQ3iMrJwIKsewmh12Y3Wvbs4vlYw9fV3DmeJaYAI66xldoXlWzRnvtPfhcIF be5Z8TQjiNoRB30xXYWviJt/iaLp8DsikyxZ1vlCMa9KvYJBcBIF1rFaY75oSdfbh3e/Hq uj6dHlAoKmr9yY028YIuJfloZjRghzkVf8XjhfD21idlxmABpxhtbFhT9gbxC2JJawfyF3 nKa/21NPGDlMskSAECOISbT6pjO/OaEA38V+eRrEj8CohczrSukhTUR/CaIigg== 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 4Vwl1M3yVzzJyb; Fri, 7 Jun 2024 15:07:35 +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 457F7ZnJ003719; Fri, 7 Jun 2024 15:07:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 457F7Z7T003716; Fri, 7 Jun 2024 15:07:35 GMT (envelope-from git) Date: Fri, 7 Jun 2024 15:07:35 GMT Message-Id: <202406071507.457F7Z7T003716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 0dfd11abc4bd - main - bpf: Make bpf_peers_present a boolean inline function List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0dfd11abc4bd0dcb96a6d287cc4e52e8f59b64c1 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0dfd11abc4bd0dcb96a6d287cc4e52e8f59b64c1 commit 0dfd11abc4bd0dcb96a6d287cc4e52e8f59b64c1 Author: Zhenlei Huang AuthorDate: 2024-06-07 15:06:08 +0000 Commit: Zhenlei Huang CommitDate: 2024-06-07 15:06:08 +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 --- 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 0fd7c4105b30..e44a7cd2359d 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -433,15 +433,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) \