diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2018-04-24 15:40:56 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2018-04-24 15:40:56 +0000 |
commit | 4fb053a8d5cca51b3ebdf34a236bd5320909952f (patch) | |
tree | 56a5ae16ddb5725b60694a08fe1e51f58fcda641 /sys/netinet/tcp_usrreq.c | |
parent | 6c06375dd84ae705761d3028fc7ccc6d3e02f786 (diff) |
Push NET_LOCK down in the default ifioctl case.
For the PRU_CONTROL bit the NET_LOCK surrounds in[6]_control() and
on the ENOTSUPP case we guard the driver if_ioctl functions.
OK mpi@
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index cd7f7e398dd..6b1e036b574 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.167 2018/02/05 14:53:26 bluhm Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.168 2018/04/24 15:40:55 pirofti Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -131,8 +131,6 @@ tcp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, int error = 0; short ostate; - soassertlocked(so); - if (req == PRU_CONTROL) { #ifdef INET6 if (sotopf(so) == PF_INET6) @@ -143,6 +141,9 @@ tcp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, return (in_control(so, (u_long)m, (caddr_t)nam, (struct ifnet *)control)); } + + soassertlocked(so); + if (control && control->m_len) { m_freem(control); m_freem(m); |