diff options
author | 2015-11-19 13:40:46 +0000 | |
---|---|---|
committer | 2015-11-19 13:40:46 +0000 | |
commit | e3f7e1de40df60dcc77ae1e2858ba84f3cef8533 (patch) | |
tree | b773d71b9cbebc6ed4ed7f7f5490196a88658bcd /sys/netinet/ip_output.c | |
parent | Add SIMPLEQ_CONCAT and TAILQ_CONCAT for moving one queue onto the end (diff) | |
download | wireguard-openbsd-e3f7e1de40df60dcc77ae1e2858ba84f3cef8533.tar.xz wireguard-openbsd-e3f7e1de40df60dcc77ae1e2858ba84f3cef8533.zip |
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/ip_output.c')
-rw-r--r-- | sys/netinet/ip_output.c | 9 |
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; } |