if_stf: Free entire mbuf chain on failure

Reported by:	 Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:	markj, bz, kp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57476
This commit is contained in:
Ed Maste
2026-06-05 16:56:51 -04:00
parent 8d9dff23f2
commit 5a7f41e94b
+2 -2
View File
@@ -801,13 +801,13 @@ in_stf_input(struct mbuf *m, int off, int proto, void *arg)
*/
nh = fib6_lookup(sc->sc_fibnum, &ip6->ip6_dst, 0, 0, 0);
if (nh == NULL) {
m_free(m);
m_freem(m);
SDT_PROBE2(if_stf, , stf_input, out, IPPROTO_DONE, __LINE__);
return (IPPROTO_DONE);
}
if ((nh->nh_ifp == ifp) &&
(!IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &nh->gw6_sa.sin6_addr))) {
m_free(m);
m_freem(m);
SDT_PROBE2(if_stf, , stf_input, out, IPPROTO_DONE, __LINE__);
return (IPPROTO_DONE);
}