mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-19 02:29:40 +00:00
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 (cherry picked from commit0dfd11abc4
) (cherry picked from commit6ad2e347fc
)
This commit is contained in:
parent
43bb3553f1
commit
d27149888c
@ -431,15 +431,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) do { \
|
||||
|
Loading…
Reference in New Issue
Block a user