summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-01-03 10:52:22 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-01-03 10:52:22 +0000
commitcf5fea89a275c7dd03fb19baaf5bd6e96253a853 (patch)
treed8a92b2536161870338ecfa4ef157498588d5d1e /sys/netinet
parent8f2e139d9449860591ef2a265edc7d31c2cdd3ac (diff)
Remove some recursives splsoftnet().
ok visa@, mikeb@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_gre.c5
-rw-r--r--sys/netinet/tcp_usrreq.c10
2 files changed, 6 insertions, 9 deletions
diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c
index b54fb99b64d..58dee961cfe 100644
--- a/sys/netinet/ip_gre.c
+++ b/sys/netinet/ip_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_gre.c,v 1.59 2016/03/04 22:38:23 sashan Exp $ */
+/* $OpenBSD: ip_gre.c,v 1.60 2017/01/03 10:52:21 mpi Exp $ */
/* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -411,12 +411,10 @@ gre_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
struct inpcb *inp = sotoinpcb(so);
if (inp != NULL && inp->inp_pipex && req == PRU_SEND) {
- int s;
struct sockaddr_in *sin4;
struct in_addr *ina_dst;
struct pipex_session *session;
- s = splsoftnet();
ina_dst = NULL;
if ((so->so_state & SS_ISCONNECTED) != 0) {
inp = sotoinpcb(so);
@@ -432,7 +430,6 @@ gre_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
(session = pipex_pptp_userland_lookup_session_ipv4(m,
*ina_dst)))
m = pipex_pptp_userland_output(m, session);
- splx(s);
if (m == NULL)
return (ENOMEM);
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index e61d6545970..39705864219 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.140 2016/12/26 21:30:10 jca Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.141 2017/01/03 10:52:21 mpi Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -732,7 +732,7 @@ tcp_usrclosed(struct tcpcb *tp)
int
tcp_ident(void *oldp, size_t *oldlenp, void *newp, size_t newlen, int dodrop)
{
- int error = 0, s;
+ int error = 0;
struct tcp_ident_mapping tir;
struct inpcb *inp;
struct tcpcb *tp = NULL;
@@ -741,6 +741,9 @@ tcp_ident(void *oldp, size_t *oldlenp, void *newp, size_t newlen, int dodrop)
struct sockaddr_in6 *fin6, *lin6;
struct in6_addr f6, l6;
#endif
+
+ splsoftassert(IPL_SOFTNET);
+
if (dodrop) {
if (oldp != NULL || *oldlenp != 0)
return (EINVAL);
@@ -781,7 +784,6 @@ tcp_ident(void *oldp, size_t *oldlenp, void *newp, size_t newlen, int dodrop)
return (EINVAL);
}
- s = splsoftnet();
switch (tir.faddr.ss_family) {
#ifdef INET6
case AF_INET6:
@@ -803,7 +805,6 @@ tcp_ident(void *oldp, size_t *oldlenp, void *newp, size_t newlen, int dodrop)
tp = tcp_drop(tp, ECONNABORTED);
else
error = ESRCH;
- splx(s);
return (error);
}
@@ -830,7 +831,6 @@ tcp_ident(void *oldp, size_t *oldlenp, void *newp, size_t newlen, int dodrop)
tir.ruid = -1;
tir.euid = -1;
}
- splx(s);
*oldlenp = sizeof (tir);
error = copyout((void *)&tir, oldp, sizeof (tir));