aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/ip6_forward.c
diff options
context:
space:
mode:
authorPawel Biernacki <kaktus@FreeBSD.org>2023-03-13 16:39:20 +0000
committerPawel Biernacki <kaktus@FreeBSD.org>2023-03-13 16:47:06 +0000
commit35b6e52c30a290e081710b87ff0be21f4941d3f4 (patch)
tree4caa8c423da17ab542070839c29c8141562eefd8 /sys/netinet6/ip6_forward.c
parent3eaffc626589eb2fc20a3c9c87eb8ab0ee89e783 (diff)
net.inet6.ip6.log_interval: use ppsratecheck(9) internally
Reported by: mjg Differential Revision: https://reviews.freebsd.org/D38758
Diffstat (limited to 'sys/netinet6/ip6_forward.c')
-rw-r--r--sys/netinet6/ip6_forward.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index fc00eab4b784..293fcd977344 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -114,9 +114,7 @@ ip6_forward(struct mbuf *m, int srcrt)
IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) {
IP6STAT_INC(ip6s_cantforward);
/* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard) */
- if (V_ip6_log_cannot_forward &&
- (V_ip6_log_time + V_ip6_log_interval < time_uptime)) {
- V_ip6_log_time = time_uptime;
+ if (V_ip6_log_cannot_forward && ip6_log_ratelimit()) {
log(LOG_DEBUG,
"cannot forward "
"from %s to %s nxt %d received on %s\n",
@@ -222,9 +220,7 @@ again:
IP6STAT_INC(ip6s_badscope);
in6_ifstat_inc(nh->nh_ifp, ifs6_in_discard);
- if (V_ip6_log_cannot_forward &&
- (V_ip6_log_time + V_ip6_log_interval < time_uptime)) {
- V_ip6_log_time = time_uptime;
+ if (V_ip6_log_cannot_forward && ip6_log_ratelimit()) {
log(LOG_DEBUG,
"cannot forward "
"src %s, dst %s, nxt %d, rcvif %s, outif %s\n",