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. 16d878cc99 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
This commit is contained in:
Zhenlei Huang 2024-06-07 23:06:08 +08:00
parent 89204d9dcb
commit 0dfd11abc4

View file

@ -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) \