diff options
| author | 2017-02-01 20:59:47 +0000 | |
|---|---|---|
| committer | 2017-02-01 20:59:47 +0000 | |
| commit | 490e07389287ee0220d61374d4494b51bf6c4492 (patch) | |
| tree | 9fac3a8a03787a9dd2622cff8c29c632a3dfefa7 /sys/netinet6/icmp6.c | |
| parent | Add a missing sizeof(*lines) factor to previous commit to ensure we zero (diff) | |
| download | wireguard-openbsd-490e07389287ee0220d61374d4494b51bf6c4492.tar.xz wireguard-openbsd-490e07389287ee0220d61374d4494b51bf6c4492.zip | |
In sogetopt, preallocate an mbuf to avoid using sleeping mallocs with
the netlock held. This also changes the prototypes of the *ctloutput
functions to take an mbuf instead of an mbuf pointer.
help, guidance from bluhm@ and mpi@
ok bluhm@
Diffstat (limited to 'sys/netinet6/icmp6.c')
| -rw-r--r-- | sys/netinet6/icmp6.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 807cdae021f..5041109341c 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.197 2017/01/19 14:49:19 bluhm Exp $ */ +/* $OpenBSD: icmp6.c,v 1.198 2017/02/01 20:59:47 dhill Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -1802,11 +1802,10 @@ fail: */ int icmp6_ctloutput(int op, struct socket *so, int level, int optname, - struct mbuf **mp) + struct mbuf *m) { int error = 0; struct inpcb *in6p = sotoinpcb(so); - struct mbuf *m = *mp; if (level != IPPROTO_ICMPV6) { if (op == PRCO_SETOPT) @@ -1853,7 +1852,6 @@ icmp6_ctloutput(int op, struct socket *so, int level, int optname, error = EINVAL; break; } - *mp = m = m_get(M_WAIT, MT_SOOPTS); m->m_len = sizeof(struct icmp6_filter); p = mtod(m, struct icmp6_filter *); bcopy(in6p->inp_icmp6filt, p, |
