packets.
Found by Hrvoje Popovski.
ok visa@, bluhm@
-/* $OpenBSD: ip6_forward.c,v 1.96 2017/11/21 12:05:09 mpi Exp $ */
+/* $OpenBSD: ip6_forward.c,v 1.97 2017/11/28 15:32:51 mpi Exp $ */
/* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */
/*
* modified by a redirect.
*/
ifp = if_get(rt->rt_ifidx);
- if (ifp == NULL)
+ if (ifp == NULL) {
+ m_freem(m);
goto freecopy;
+ }
if (rt->rt_ifidx == m->m_pkthdr.ph_ifidx && !srcrt &&
ip6_sendredirects &&
(rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) {