git: 6ad2e347fcf8 - stable/14 - bpf: Make bpf_peers_present a boolean inline function
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 17 Jun 2024 04:03:28 UTC
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6ad2e347fcf8fa6aa9ebd84cfa4c71a1af90b4dd commit 6ad2e347fcf8fa6aa9ebd84cfa4c71a1af90b4dd Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-06-07 15:06:08 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> 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) \