diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -341,10 +341,8 @@ } /* Finally, do rate limitation check. */ - if (icmp6_ratelimit(&oip6->ip6_src, type, code)) { - ICMP6STAT_INC(icp6s_toofreq); + if (icmp6_ratelimit(&oip6->ip6_src, type, code)) goto freeit; - } /* * OK, ICMP6 can be generated. @@ -2744,6 +2742,7 @@ V_icmp6errppslim)) { /* The packet is subject to rate limit */ ret++; + ICMP6STAT_INC(icp6s_toofreq); } return ret;