Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Mar 2024 16:19:31 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: c6c96aaba8dd - main - icmp6: make icmp6_ratelimit() responsible to update the stats counter
Message-ID:  <202403241619.42OGJVie079505@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=c6c96aaba8dd74eb39469ed156ff19cc31d599b7

commit c6c96aaba8dd74eb39469ed156ff19cc31d599b7
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2024-03-24 16:13:23 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2024-03-24 16:13:23 +0000

    icmp6: make icmp6_ratelimit() responsible to update the stats counter
    
    Reviewed by:            tuexen
    Differential Revision:  https://reviews.freebsd.org/D44479
---
 sys/netinet6/icmp6.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 671fb91da4bf..260f5c7e2467 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -341,10 +341,8 @@ icmp6_error(struct mbuf *m, int type, int code, int param)
 	}
 
 	/* 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 @@ icmp6_ratelimit(const struct in6_addr *dst, const int type,
 	    V_icmp6errppslim)) {
 		/* The packet is subject to rate limit */
 		ret++;
+		ICMP6STAT_INC(icp6s_toofreq);
 	}
 
 	return ret;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403241619.42OGJVie079505>