In previous commit when refactoring the route cache, a rtfree() has
been forgotten. For each forwarded packet the reference counter
of the route entry was increased. This eventually leads to an
integer overflow and triggers kassert.
reported by and OK jan@
-/* $OpenBSD: ip_input.c,v 1.393 2024/04/16 12:56:39 bluhm Exp $ */
+/* $OpenBSD: ip_input.c,v 1.394 2024/05/08 13:01:30 bluhm Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
ip_forward(m, ifp, &ro, pfrdr);
*mp = NULL;
+ rtfree(ro.ro_rt);
return IPPROTO_DONE;
bad:
nxt = IPPROTO_DONE;
-/* $OpenBSD: ip6_input.c,v 1.261 2024/04/16 12:56:39 bluhm Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.262 2024/05/08 13:01:30 bluhm Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
ip6_forward(m, &ro, pfrdr);
*mp = NULL;
+ rtfree(ro.ro_rt);
return IPPROTO_DONE;
bad:
nxt = IPPROTO_DONE;