From eugen@eg.sd.rdtc.ru  Thu Jun  3 02:55:51 2010
Return-Path: <eugen@eg.sd.rdtc.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E0A91065670
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  3 Jun 2010 02:55:51 +0000 (UTC)
	(envelope-from eugen@eg.sd.rdtc.ru)
Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [62.231.161.221])
	by mx1.freebsd.org (Postfix) with ESMTP id 9E62B8FC1C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  3 Jun 2010 02:55:50 +0000 (UTC)
Received: from eg.sd.rdtc.ru (localhost [127.0.0.1])
	by eg.sd.rdtc.ru (8.14.4/8.14.4) with ESMTP id o532tlgv014905
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 3 Jun 2010 09:55:47 +0700 (NOVST)
	(envelope-from eugen@eg.sd.rdtc.ru)
Received: (from eugen@localhost)
	by eg.sd.rdtc.ru (8.14.4/8.14.3/Submit) id o532tl4R014904;
	Thu, 3 Jun 2010 09:55:47 +0700 (NOVST)
	(envelope-from eugen)
Message-Id: <201006030255.o532tl4R014904@eg.sd.rdtc.ru>
Date: Thu, 3 Jun 2010 09:55:47 +0700 (NOVST)
From: Eugene Grosbein <eugen@eg.sd.rdtc.ru>
Reply-To: Eugene Grosbein <eugen@eg.sd.rdtc.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [net] [patch] replace printf() with log() for "Limiting ..."
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         147352
>Category:       kern
>Synopsis:       [netinet] [patch] replace printf() with log() for "Limiting ..."
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    andre
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 03 03:00:13 UTC 2010
>Closed-Date:    Mon Aug 23 14:25:33 UTC 2010
>Last-Modified:  Mon Aug 23 14:25:33 UTC 2010
>Originator:     Eugene Grosbein
>Release:        FreeBSD 8.0-STABLE i386
>Organization:
RDTC JSC
>Environment:
System: FreeBSD eg.sd.rdtc.ru 8.0-STABLE FreeBSD 8.0-STABLE #13: Fri Apr 30 11:44:37 NOVST 2010 root@eg.sd.rdtc.ru:/usr/local/obj/usr/local/src/sys/EG i386

>Description:
	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.

>Fix:

--- sys/netinet/ip_icmp.c.orig	2010-06-03 09:26:47.000000000 +0700
+++ sys/netinet/ip_icmp.c	2010-06-03 09:31:24.000000000 +0700
@@ -42,6 +42,7 @@
 #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>
@@ -994,7 +995,7 @@
 		 * 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_WARNING, "Limiting %s from %d to %d packets/sec\n",
 				r->type, opps, V_icmplim);
 	}
 	return 0;			/* okay to send packet */


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Jun 3 03:18:35 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147352 
Responsible-Changed-From-To: freebsd-net->andre 
Responsible-Changed-By: andre 
Responsible-Changed-When: Tue Aug 10 22:09:49 UTC 2010 
Responsible-Changed-Why:  
Take over. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147352 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/147352: commit references a PR
Date: Sat, 14 Aug 2010 21:04:36 +0000 (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"
 
State-Changed-From-To: open->patched 
State-Changed-By: andre 
State-Changed-When: Sat Aug 14 22:32:32 UTC 2010 
State-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=147352 
State-Changed-From-To: patched->closed 
State-Changed-By: andre 
State-Changed-When: Mon Aug 23 14:25:15 UTC 2010 
State-Changed-Why:  
All MFC's done. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147352 
>Unformatted:
