diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-11 03:45:42 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-11 03:45:42 +0000 |
commit | 0fa5ca52c65380abf9eefde88e7944f404a629ff (patch) | |
tree | 0768ddac3e54631224df550401762271bdbf7d17 /sys | |
parent | 71dd84f2b8ab9098090e5a616277d3724c8ee483 (diff) | |
download | FreeBSD-src-0fa5ca52c65380abf9eefde88e7944f404a629ff.zip FreeBSD-src-0fa5ca52c65380abf9eefde88e7944f404a629ff.tar.gz |
Un-staticize 'dst' sockaddr in the stack of bpfwrite() to prevent
the need to synchronize access to the structure. I believe this
should fit into the stack under the necessary circumstances, but
if not we can either add synchronization or use a thread-local
malloc for the duration.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/bpf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 87d4940..8d01cd9 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -553,7 +553,7 @@ bpfwrite(dev, uio, ioflag) struct ifnet *ifp; struct mbuf *m; int error; - static struct sockaddr dst; + struct sockaddr dst; int datlen; if (d->bd_bif == 0) @@ -564,6 +564,7 @@ bpfwrite(dev, uio, ioflag) if (uio->uio_resid == 0) return (0); + bzero(&dst, sizeof(dst)); error = bpf_movein(uio, (int)d->bd_bif->bif_dlt, &m, &dst, &datlen); if (error) return (error); |