summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-11-20 10:35:25 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-11-20 10:35:25 +0000
commitb840bc0df785d41fe495aa78fda03f64683701ed (patch)
treeddba3dcfc73baa0f2746854f1b0f2aad8cb73d52 /sys/netinet6
parent5da939dc8afafa50ffbd55badab9d9a6c8dab59f (diff)
Sprinkle some NET_ASSERT_LOCKED(), const and co to prepare running
pr_input handlers without KERNEL_LOCK(). ok visa@
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6.h4
-rw-r--r--sys/netinet6/ip6_input.c4
-rw-r--r--sys/netinet6/raw_ip6.c9
3 files changed, 10 insertions, 7 deletions
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);