diff --git a/sys/netinet6/ip6_flow.c b/sys/netinet6/ip6_flow.c index 6c56d3b08ca8..e69c873b81fe 100644 --- a/sys/netinet6/ip6_flow.c +++ b/sys/netinet6/ip6_flow.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_flow.c,v 1.22 2014/04/01 13:11:44 pooka Exp $ */ +/* $NetBSD: ip6_flow.c,v 1.23 2014/05/20 20:23:56 bouyer Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip6_flow.c,v 1.22 2014/04/01 13:11:44 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_flow.c,v 1.23 2014/05/20 20:23:56 bouyer Exp $"); #include #include @@ -308,13 +308,14 @@ ip6flow_fastforward(struct mbuf **mp) ip6f->ip6f_uses++; + KERNEL_LOCK(1, NULL); /* Send on its way - straight to the interface output routine. */ if ((error = (*rt->rt_ifp->if_output)(rt->rt_ifp, m, dst, rt)) != 0) { ip6f->ip6f_dropped++; } else { ip6f->ip6f_forwarded++; } - + KERNEL_UNLOCK_ONE(NULL); return 1; } diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 745bec0acd65..e41c3cf86680 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $NetBSD: nd6.c,v 1.149 2014/05/17 20:44:24 rmind Exp $ */ +/* $NetBSD: nd6.c,v 1.150 2014/05/20 20:23:56 bouyer Exp $ */ /* $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.149 2014/05/17 20:44:24 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.150 2014/05/20 20:23:56 bouyer Exp $"); #include "opt_ipsec.h" @@ -2257,9 +2257,13 @@ nd6_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0, goto bad; } + KERNEL_LOCK(1, NULL); if ((ifp->if_flags & IFF_LOOPBACK) != 0) - return (*ifp->if_output)(origifp, m, sin6tocsa(dst), rt); - return (*ifp->if_output)(ifp, m, sin6tocsa(dst), rt); + error = (*ifp->if_output)(origifp, m, sin6tocsa(dst), rt); + else + error = (*ifp->if_output)(ifp, m, sin6tocsa(dst), rt); + KERNEL_UNLOCK_ONE(NULL); + return error; bad: if (m != NULL)