diff options
author | jlemon <jlemon@FreeBSD.org> | 2001-02-16 17:10:28 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2001-02-16 17:10:28 +0000 |
commit | 21e5f66dd3c810b0ddadbf189058b56cee4f0463 (patch) | |
tree | 4da197bbd53bc2513d6a91c86cb904894872bb8f /sys/net/bpfdesc.h | |
parent | 8c0f93bb9b66766fdbcc5b8376b17f0f904f31ec (diff) | |
download | FreeBSD-src-21e5f66dd3c810b0ddadbf189058b56cee4f0463.zip FreeBSD-src-21e5f66dd3c810b0ddadbf189058b56cee4f0463.tar.gz |
Add mutexes to the entire bpf subsystem to make it MPSAFE.
Previously reviewed by: jhb, bde
Diffstat (limited to 'sys/net/bpfdesc.h')
-rw-r--r-- | sys/net/bpfdesc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/net/bpfdesc.h b/sys/net/bpfdesc.h index 49e3f35..9172c7f 100644 --- a/sys/net/bpfdesc.h +++ b/sys/net/bpfdesc.h @@ -89,8 +89,12 @@ struct bpf_d { u_char bd_pad; /* explicit alignment */ struct selinfo bd_sel; /* bsd select info */ #endif + struct mtx bd_mtx; /* mutex for this descriptor */ }; +#define BPFD_LOCK(bd) mtx_lock(&(bd)->bd_mtx) +#define BPFD_UNLOCK(bd) mtx_unlock(&(bd)->bd_mtx) + /* * Descriptor associated with each attached hardware interface. */ @@ -100,6 +104,10 @@ struct bpf_if { u_int bif_dlt; /* link layer type */ u_int bif_hdrlen; /* length of header (with padding) */ struct ifnet *bif_ifp; /* corresponding interface */ + struct mtx bif_mtx; /* mutex for interface */ }; +#define BPFIF_LOCK(bif) mtx_lock(&(bif)->bif_mtx) +#define BPFIF_UNLOCK(bif) mtx_unlock(&(bif)->bif_mtx) + #endif |