diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index d24b3ceaaa47..69712fd45bcd 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -239,7 +239,8 @@ rip6_input(struct mbuf **mp, int *offp, int proto) } if (in6p->in6p_cksum != -1) { RIP6STAT_INC(rip6s_isum); - if (in6_cksum(m, proto, *offp, + if (m->m_pkthdr.len - (*offp + in6p->in6p_cksum) < 2 || + in6_cksum(m, proto, *offp, m->m_pkthdr.len - *offp)) { RIP6STAT_INC(rip6s_badsum); goto skip_2;