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/ip_divert.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/ip_divert.c')
-rw-r--r-- | sys/netinet/ip_divert.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 1e1c2e200af..78d7f16e3f6 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_divert.c,v 1.56 2017/11/02 14:01:18 florian Exp $ */ +/* $OpenBSD: ip_divert.c,v 1.57 2018/04/24 15:40:55 pirofti Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -242,12 +242,13 @@ divert_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *addr, struct inpcb *inp = sotoinpcb(so); int error = 0; - soassertlocked(so); - if (req == PRU_CONTROL) { return (in_control(so, (u_long)m, (caddr_t)addr, (struct ifnet *)control)); } + + soassertlocked(so); + if (inp == NULL) { error = EINVAL; goto release; |