From 40fe9eff47f57ec4367be5cb38e75761087dd6da Mon Sep 17 00:00:00 2001 From: Andre Oppermann Date: Sat, 14 Aug 2010 21:04:27 +0000 Subject: [PATCH] Change the messages of the ICMP bad port bandwidth limiter from a kernel printf to a log output with the priority of LOG_NOTICE. This way the messages still show up in /var/log/messages but no longer spam the console every other second on busy servers that are port scanned: "Limiting open port RST response from 114 to 100 packets/sec" PR: kern/147352 Submitted by: Eugene Grosbein MFC after: 1 week --- sys/netinet/ip_icmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 8dc08d9336c..480a2c80db5 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -975,7 +976,7 @@ badport_bandlim(int which) * the previous behaviour at the expense of added complexity. */ if (V_icmplim_output && opps > V_icmplim) - printf("Limiting %s from %d to %d packets/sec\n", + log(LOG_NOTICE, "Limiting %s from %d to %d packets/sec\n", r->type, opps, V_icmplim); } return 0; /* okay to send packet */