On Mon, Nov 20, 2017 at 02:46:22PM +0100, Martin Pieuchot wrote:
> The problem is that ip6_forward() contains an unchecked if_get(). Diff
> below should fix that.
OK bluhm@
> Index: netinet6/ip6_forward.c
> ===================================================================
> RCS file: /cvs/src/sys/netinet6/ip6_forward.c,v
> retrieving revision 1.95
> diff -u -p -r1.95 ip6_forward.c
> --- netinet6/ip6_forward.c 30 Jun 2017 11:29:15 -0000 1.95
> +++ netinet6/ip6_forward.c 20 Nov 2017 13:43:37 -0000
> @@ -240,6 +240,8 @@ reroute:
> * modified by a redirect.
> */
> ifp = if_get(rt->rt_ifidx);
> + if (ifp == NULL)
> + goto freecopy;
> if (rt->rt_ifidx == m->m_pkthdr.ph_ifidx && !srcrt &&
> ip6_sendredirects &&
> (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) {