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.
This commit is contained in:
Robert Watson 2004-06-11 03:45:42 +00:00
parent c14800e6ff
commit 8240bf1e04
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130334

View File

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