From 808b116a48cf0ca094d58c930b94f934a57c0cac Mon Sep 17 00:00:00 2001 From: ozaki-r Date: Tue, 9 May 2017 04:24:10 +0000 Subject: [PATCH] Add missing KEY_FREESP to ip6_forward --- sys/netinet6/ip6_forward.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index 87433f129f6e..3e7d4453da97 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_forward.c,v 1.86 2017/02/14 03:05:06 ozaki-r Exp $ */ +/* $NetBSD: ip6_forward.c,v 1.87 2017/05/09 04:24:10 ozaki-r Exp $ */ /* $KAME: ip6_forward.c,v 1.109 2002/09/11 08:10:17 sakane Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip6_forward.c,v 1.86 2017/02/14 03:05:06 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_forward.c,v 1.87 2017/05/09 04:24:10 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_gateway.h" @@ -460,6 +460,10 @@ ip6_forward(struct mbuf *m, int srcrt) drop: m_freem(m); out: +#ifdef IPSEC + if (sp != NULL) + KEY_FREESP(&sp); +#endif rtcache_unref(rt, ro); if (ro != NULL) percpu_putref(ip6_forward_rt_percpu);