summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-11-19 13:40:47 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-11-19 13:40:47 +0000
commit5a552a12391fea5331823e8ceee414ae9e11a34d (patch)
tree7ee095781c3b2d3cfc09f7fbedcefc8780f5927c /sys/netinet
parent6b7243aaae190bed09252c2567ec21a40e577c45 (diff)
Grab the KERNEL_LOCK around ip_mforward(), in preparation for unlocking
ip_output(). Note that ipmforwarding is not enabled by default.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_output.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 6833a0c3133..2b5fde7cd6c 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.306 2015/11/11 10:23:23 mpi Exp $ */
+/* $OpenBSD: ip_output.c,v 1.307 2015/11/19 13:40:46 mpi Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -368,7 +368,12 @@ reroute:
*/
if (ipmforwarding && ip_mrouter &&
(flags & IP_FORWARDING) == 0) {
- if (ip_mforward(m, ifp) != 0) {
+ int rv;
+
+ KERNEL_LOCK();
+ rv = ip_mforward(m, ifp);
+ KERNEL_UNLOCK();
+ if (rv != 0) {
m_freem(m);
goto done;
}