summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/if_etherip.c4
-rw-r--r--sys/net/if_gif.c7
-rw-r--r--sys/net/if_pfsync.c4
-rw-r--r--sys/net/if_vxlan.c3
-rw-r--r--sys/net/pf.c4
-rw-r--r--sys/net/pipex.c3
-rw-r--r--sys/netinet/igmp.c5
-rw-r--r--sys/netinet/in.h4
-rw-r--r--sys/netinet/ip_carp.c8
-rw-r--r--sys/netinet/ip_ether.c3
-rw-r--r--sys/netinet/ip_gre.c3
-rw-r--r--sys/netinet/ip_input.c4
-rw-r--r--sys/netinet/ipsec_input.c3
-rw-r--r--sys/netinet/raw_ip.c10
-rw-r--r--sys/netinet/tcp_input.c3
-rw-r--r--sys/netinet/tcp_usrreq.c3
-rw-r--r--sys/netinet/udp_usrreq.c11
-rw-r--r--sys/netinet6/in6.h4
-rw-r--r--sys/netinet6/ip6_input.c4
-rw-r--r--sys/netinet6/raw_ip6.c9
20 files changed, 66 insertions, 33 deletions
diff --git a/sys/net/if_etherip.c b/sys/net/if_etherip.c
index 8d6e628c9c1..b7633a6e91d 100644
--- a/sys/net/if_etherip.c
+++ b/sys/net/if_etherip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_etherip.c,v 1.27 2017/11/17 18:22:52 jca Exp $ */
+/* $OpenBSD: if_etherip.c,v 1.28 2017/11/20 10:35:24 mpi Exp $ */
/*
* Copyright (c) 2015 Kazuya GODA <goda@openbsd.org>
*
@@ -424,6 +424,7 @@ ip_etherip_input(struct mbuf **mp, int *offp, int proto, int af)
return IPPROTO_DONE;
}
+ NET_ASSERT_LOCKED();
LIST_FOREACH(sc, &etherip_softc_list, sc_entry) {
if (sc->sc_src.ss_family != AF_INET ||
sc->sc_dst.ss_family != AF_INET)
@@ -577,6 +578,7 @@ ip6_etherip_input(struct mbuf **mp, int *offp, int proto, int af)
in6_recoverscope(&ipsrc, &ip6->ip6_src);
in6_recoverscope(&ipdst, &ip6->ip6_dst);
+ NET_ASSERT_LOCKED();
LIST_FOREACH(sc, &etherip_softc_list, sc_entry) {
if (sc->sc_src.ss_family != AF_INET6 ||
sc->sc_dst.ss_family != AF_INET6)
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 22481bf3414..a9f03716a1f 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gif.c,v 1.104 2017/11/17 20:38:33 jca Exp $ */
+/* $OpenBSD: if_gif.c,v 1.105 2017/11/20 10:35:24 mpi Exp $ */
/* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */
/*
@@ -621,6 +621,7 @@ in_gif_input(struct mbuf **mp, int *offp, int proto, int af)
ip = mtod(m, struct ip *);
+ NET_ASSERT_LOCKED();
/* this code will be soon improved. */
LIST_FOREACH(sc, &gif_softc_list, gif_list) {
if (sc->gif_psrc == NULL || sc->gif_pdst == NULL ||
@@ -729,7 +730,8 @@ in6_gif_output(struct ifnet *ifp, int family, struct mbuf **m0)
return 0;
}
-int in6_gif_input(struct mbuf **mp, int *offp, int proto, int af)
+int
+in6_gif_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
struct gif_softc *sc;
@@ -746,6 +748,7 @@ int in6_gif_input(struct mbuf **mp, int *offp, int proto, int af)
in6_recoverscope(&src, &ip6->ip6_src);
in6_recoverscope(&dst, &ip6->ip6_dst);
+ NET_ASSERT_LOCKED();
LIST_FOREACH(sc, &gif_softc_list, gif_list) {
if (sc->gif_psrc == NULL || sc->gif_pdst == NULL ||
sc->gif_psrc->sa_family != AF_INET6 ||
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index bd5261c5192..7c03704adba 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.254 2017/08/11 21:24:19 mpi Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.255 2017/11/20 10:35:24 mpi Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -659,6 +659,8 @@ pfsync_input(struct mbuf **mp, int *offp, int proto, int af)
int offset, noff, len, count, mlen, flags = 0;
int e;
+ NET_ASSERT_LOCKED();
+
pfsyncstat_inc(pfsyncs_ipackets);
/* verify that we have a sync interface configured */
diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c
index 190b2b880d3..07f9b7739e2 100644
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vxlan.c,v 1.63 2017/10/25 09:24:09 mpi Exp $ */
+/* $OpenBSD: if_vxlan.c,v 1.64 2017/11/20 10:35:24 mpi Exp $ */
/*
* Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org>
@@ -611,6 +611,7 @@ vxlan_lookup(struct mbuf *m, struct udphdr *uh, int iphlen,
vni = VXLAN_VNI_UNSET;
}
+ NET_ASSERT_LOCKED();
/* First search for a vxlan(4) interface with the packet's VNI */
LIST_FOREACH(sc, &vxlan_tagh[VXLAN_TAGHASH(vni)], sc_entry) {
if ((uh->uh_dport == sc->sc_dstport) &&
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 3382ee63e7c..88806a8521c 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.1045 2017/11/13 11:30:11 henning Exp $ */
+/* $OpenBSD: pf.c,v 1.1046 2017/11/20 10:35:24 mpi Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -3189,12 +3189,14 @@ pf_socket_lookup(struct pf_pdesc *pd)
sport = pd->hdr.tcp.th_sport;
dport = pd->hdr.tcp.th_dport;
PF_ASSERT_LOCKED();
+ NET_ASSERT_LOCKED();
tb = &tcbtable;
break;
case IPPROTO_UDP:
sport = pd->hdr.udp.uh_sport;
dport = pd->hdr.udp.uh_dport;
PF_ASSERT_LOCKED();
+ NET_ASSERT_LOCKED();
tb = &udbtable;
break;
default:
diff --git a/sys/net/pipex.c b/sys/net/pipex.c
index 9f4d1604ff0..626bfacdbe6 100644
--- a/sys/net/pipex.c
+++ b/sys/net/pipex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pipex.c,v 1.105 2017/08/11 21:24:19 mpi Exp $ */
+/* $OpenBSD: pipex.c,v 1.106 2017/11/20 10:35:24 mpi Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
@@ -637,6 +637,7 @@ pipex_lookup_by_session_id(int protocol, int session_id)
struct pipex_hash_head *list;
struct pipex_session *session;
+ NET_ASSERT_LOCKED();
list = PIPEX_ID_HASHTABLE(session_id);
LIST_FOREACH(session, list, id_chain) {
if (session->protocol == protocol &&
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index c9107cb58e8..88d54ba0619 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: igmp.c,v 1.71 2017/10/29 14:56:36 florian Exp $ */
+/* $OpenBSD: igmp.c,v 1.72 2017/11/20 10:35:24 mpi Exp $ */
/* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */
/*
@@ -177,6 +177,7 @@ rti_find(struct ifnet *ifp)
{
struct router_info *rti;
+ KERNEL_ASSERT_LOCKED();
for (rti = rti_head; rti != 0; rti = rti->rti_next) {
if (rti->rti_ifidx == ifp->if_index)
return (rti);
@@ -221,7 +222,9 @@ igmp_input(struct mbuf **mp, int *offp, int proto, int af)
return IPPROTO_DONE;
}
+ KERNEL_LOCK();
proto = igmp_input_if(ifp, mp, offp, proto, af);
+ KERNEL_UNLOCK();
if_put(ifp);
return proto;
}
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index 46fb591c1d6..fc8a7b61044 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.h,v 1.126 2017/11/14 09:30:17 mpi Exp $ */
+/* $OpenBSD: in.h,v 1.127 2017/11/20 10:35:24 mpi Exp $ */
/* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */
/*
@@ -794,7 +794,7 @@ __END_DECLS
#endif /* !_KERNEL */
#ifdef _KERNEL
-extern int inetctlerrmap[];
+extern const int inetctlerrmap[];
extern struct in_addr zeroin_addr;
struct mbuf;
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 649c7501798..2d975a715b7 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.317 2017/10/16 13:20:20 mpi Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.318 2017/11/20 10:35:24 mpi Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -505,7 +505,9 @@ carp_proto_input_if(struct ifnet *ifp, struct mbuf **mp, int *offp, int proto)
}
m->m_data -= iplen;
+ KERNEL_LOCK();
carp_proto_input_c(ifp, m, ch, ismulti, AF_INET);
+ KERNEL_UNLOCK();
return IPPROTO_DONE;
}
@@ -580,7 +582,9 @@ carp6_proto_input_if(struct ifnet *ifp, struct mbuf **mp, int *offp, int proto)
}
m->m_data -= *offp;
+ KERNEL_LOCK();
carp_proto_input_c(ifp, m, ch, 1, AF_INET6);
+ KERNEL_UNLOCK();
return IPPROTO_DONE;
}
#endif /* INET6 */
@@ -1514,7 +1518,7 @@ carp_lsdrop(struct mbuf *m, sa_family_t af, u_int32_t *src, u_int32_t *dst,
m_tag_delete(m, mtag);
m->m_flags &= ~M_MCAST;
}
-
+
/*
* Return without making a drop decision. This allows to clear the
* M_MCAST flag and do nothing else.
diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c
index bcc99183b20..840f53cec2a 100644
--- a/sys/netinet/ip_ether.c
+++ b/sys/netinet/ip_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ether.c,v 1.96 2017/11/17 18:21:33 jca Exp $ */
+/* $OpenBSD: ip_ether.c,v 1.97 2017/11/20 10:35:24 mpi Exp $ */
/*
* The author of this code is Angelos D. Keromytis (kermit@adk.gr)
*
@@ -174,6 +174,7 @@ mplsip_getgif(struct mbuf *m)
return NULL;
}
+ NET_ASSERT_LOCKED();
/* Find appropriate gif(4) interface */
LIST_FOREACH(sc, &gif_softc_list, gif_list) {
if ((sc->gif_psrc == NULL) ||
diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c
index 3f3672285ef..1f56bd09119 100644
--- a/sys/netinet/ip_gre.c
+++ b/sys/netinet/ip_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_gre.c,v 1.67 2017/10/09 08:35:38 mpi Exp $ */
+/* $OpenBSD: ip_gre.c,v 1.68 2017/11/20 10:35:24 mpi Exp $ */
/* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -356,6 +356,7 @@ gre_lookup(struct mbuf *m, u_int8_t proto)
struct ip *ip = mtod(m, struct ip *);
struct gre_softc *sc;
+ NET_ASSERT_LOCKED();
LIST_FOREACH(sc, &gre_softc_list, sc_list) {
if ((sc->g_dst.s_addr == ip->ip_src.s_addr) &&
(sc->g_src.s_addr == ip->ip_dst.s_addr) &&
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 7be0c7d0c54..5eee0d5eac5 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.332 2017/11/14 09:30:17 mpi Exp $ */
+/* $OpenBSD: ip_input.c,v 1.333 2017/11/20 10:35:24 mpi Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -1386,7 +1386,7 @@ ip_stripoptions(struct mbuf *m)
ip->ip_len = htons(ntohs(ip->ip_len) - olen);
}
-int inetctlerrmap[PRC_NCMDS] = {
+const int inetctlerrmap[PRC_NCMDS] = {
0, 0, 0, 0,
0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH,
EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED,
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c
index 31aff573f73..6f0a5fad5f2 100644
--- a/sys/netinet/ipsec_input.c
+++ b/sys/netinet/ipsec_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_input.c,v 1.160 2017/11/14 09:30:17 mpi Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.161 2017/11/20 10:35:24 mpi Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -860,6 +860,7 @@ ipsec_common_ctlinput(u_int rdomain, int cmd, struct sockaddr *sa,
return;
/* Walk the chain backwards to the first tdb */
+ NET_ASSERT_LOCKED();
for (; tdbp; tdbp = tdbp->tdb_inext) {
if (tdbp->tdb_flags & TDBF_INVALID ||
(adjust = ipsec_hdrsz(tdbp)) == -1)
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 775b8a32ed4..d969c5ee66c 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip.c,v 1.105 2017/11/02 14:01:18 florian Exp $ */
+/* $OpenBSD: raw_ip.c,v 1.106 2017/11/20 10:35:24 mpi Exp $ */
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
/*
@@ -128,6 +128,7 @@ rip_input(struct mbuf **mp, int *offp, int proto, int af)
KASSERT(af == AF_INET);
ripsrc.sin_addr = ip->ip_src;
+ NET_ASSERT_LOCKED();
TAILQ_FOREACH(inp, &rawcbtable.inpt_queue, inp_queue) {
if (inp->inp_socket->so_state & SS_CANTRCVMORE)
continue;
@@ -512,10 +513,11 @@ rip_attach(struct socket *so, int proto)
if (proto < 0 || proto >= IPPROTO_MAX)
return EPROTONOSUPPORT;
- if ((error = soreserve(so, rip_sendspace, rip_recvspace)) ||
- (error = in_pcballoc(so, &rawcbtable))) {
+ if ((error = soreserve(so, rip_sendspace, rip_recvspace)))
+ return error;
+ NET_ASSERT_LOCKED();
+ if ((error = in_pcballoc(so, &rawcbtable)))
return error;
- }
inp = sotoinpcb(so);
inp->inp_ip.ip_p = proto;
return 0;
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 1688254dbe6..bf93c0899da 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.351 2017/11/08 20:19:58 bluhm Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.352 2017/11/20 10:35:24 mpi Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -579,6 +579,7 @@ findpcb:
}
KASSERT(sotoinpcb(inp->inp_socket) == inp);
KASSERT(intotcpcb(inp) == NULL || intotcpcb(inp)->t_inpcb == inp);
+ soassertlocked(inp->inp_socket);
/* Check the minimum TTL for socket. */
switch (af) {
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index b6ab40112c2..56725f20260 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.159 2017/11/02 14:01:18 florian Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.160 2017/11/20 10:35:24 mpi Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -576,6 +576,7 @@ tcp_attach(struct socket *so, int proto)
return (error);
}
+ NET_ASSERT_LOCKED();
error = in_pcballoc(so, &tcbtable);
if (error)
return (error);
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 509c949b2d8..e7c490cc107 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.243 2017/11/08 16:29:20 visa Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.244 2017/11/20 10:35:24 mpi Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -383,6 +383,7 @@ udp_input(struct mbuf **mp, int *offp, int proto, int af)
* (Algorithm copied from raw_intr().)
*/
last = NULL;
+ NET_ASSERT_LOCKED();
TAILQ_FOREACH(inp, &udbtable.inpt_queue, inp_queue) {
if (inp->inp_socket->so_state & SS_CANTRCVMORE)
continue;
@@ -564,6 +565,7 @@ udp_input(struct mbuf **mp, int *offp, int proto, int af)
}
}
KASSERT(sotoinpcb(inp->inp_socket) == inp);
+ soassertlocked(inp->inp_socket);
#ifdef INET6
if (ip6 && inp->inp_ip6_minhlim &&
@@ -1254,8 +1256,11 @@ udp_attach(struct socket *so, int proto)
if (so->so_pcb != NULL)
return EINVAL;
- if ((error = soreserve(so, udp_sendspace, udp_recvspace)) ||
- (error = in_pcballoc(so, &udbtable)))
+ if ((error = soreserve(so, udp_sendspace, udp_recvspace)))
+ return error;
+
+ NET_ASSERT_LOCKED();
+ if ((error = in_pcballoc(so, &udbtable)))
return error;
#ifdef INET6
if (sotoinpcb(so)->inp_flags & INP_IPV6)
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 397f1094a5b..6ea62f9fbd2 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.h,v 1.99 2017/09/01 16:48:27 florian Exp $ */
+/* $OpenBSD: in6.h,v 1.100 2017/11/20 10:35:24 mpi Exp $ */
/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
/*
@@ -404,7 +404,7 @@ typedef __socklen_t socklen_t; /* length type for network syscalls */
#endif /* __BSD_VISIBLE */
#ifdef _KERNEL
-extern u_char inet6ctlerrmap[];
+extern const u_char inet6ctlerrmap[];
extern struct in6_addr zeroin6_addr;
struct mbuf;
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index caf6dfeb23b..28eff435ed3 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_input.c,v 1.208 2017/11/10 08:55:49 mpi Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.209 2017/11/20 10:35:24 mpi Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
@@ -1344,7 +1344,7 @@ ip6_lasthdr(struct mbuf *m, int off, int proto, int *nxtp)
* System control for IP6
*/
-u_char inet6ctlerrmap[PRC_NCMDS] = {
+const u_char inet6ctlerrmap[PRC_NCMDS] = {
0, 0, 0, 0,
0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH,
EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED,
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 70461915c2e..0c0bd3b6cd9 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.122 2017/11/02 14:01:18 florian Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.123 2017/11/20 10:35:24 mpi Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
@@ -136,6 +136,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto, int af)
/* KAME hack: recover scopeid */
in6_recoverscope(&rip6src, &ip6->ip6_src);
+ NET_ASSERT_LOCKED();
TAILQ_FOREACH(in6p, &rawin6pcbtable.inpt_queue, inp_queue) {
if (in6p->inp_socket->so_state & SS_CANTRCVMORE)
continue;
@@ -695,8 +696,10 @@ rip6_attach(struct socket *so, int proto)
if (proto < 0 || proto >= IPPROTO_MAX)
return EPROTONOSUPPORT;
- if ((error = soreserve(so, rip6_sendspace, rip6_recvspace)) ||
- (error = in_pcballoc(so, &rawin6pcbtable)))
+ if ((error = soreserve(so, rip6_sendspace, rip6_recvspace)))
+ return error;
+ NET_ASSERT_LOCKED();
+ if ((error = in_pcballoc(so, &rawin6pcbtable)))
return error;
in6p = sotoinpcb(so);