Bug 147352

Summary: [netinet] [patch] replace printf() with log() for "Limiting ..."
Product: Base System Reporter: Eugene Grosbein <ports>
Component: kernAssignee: Andre Oppermann <andre>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 8.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Eugene Grosbein 2010-06-03 04:00:13 UTC
	Lots of messages 'Limiting open port RST response from 114 to 100 packets/sec'
	flood dmesg buffer when FreeBSD server is attached or portscanned often.

	Such diagnostics should be manageble with syslog.conf and not printed
	with kernel printf.

How-To-Repeat: 	See above.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2010-06-03 04:18:35 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Over to maintainer(s).
Comment 2 Andre Oppermann freebsd_committer freebsd_triage 2010-08-10 23:09:49 UTC
Responsible Changed
From-To: freebsd-net->andre

Take over.
Comment 3 dfilter service freebsd_committer freebsd_triage 2010-08-14 22:04:36 UTC
Author: andre
Date: Sat Aug 14 21:04:27 2010
New Revision: 211316
URL: http://svn.freebsd.org/changeset/base/211316

Log:
  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 <eugen-at-eg sd rdtc ru>
  MFC after:	1 week

Modified:
  head/sys/netinet/ip_icmp.c

Modified: head/sys/netinet/ip_icmp.c
==============================================================================
--- head/sys/netinet/ip_icmp.c	Sat Aug 14 20:40:55 2010	(r211315)
+++ head/sys/netinet/ip_icmp.c	Sat Aug 14 21:04:27 2010	(r211316)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/time.h>
 #include <sys/kernel.h>
 #include <sys/sysctl.h>
+#include <sys/syslog.h>
 
 #include <net/if.h>
 #include <net/if_types.h>
@@ -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 */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 4 Andre Oppermann freebsd_committer freebsd_triage 2010-08-14 23:32:32 UTC
State Changed
From-To: open->patched
Comment 5 Andre Oppermann freebsd_committer freebsd_triage 2010-08-23 15:25:15 UTC
State Changed
From-To: patched->closed

All MFC's done.