From owner-freebsd-net Mon Nov 5 5:43:41 2001 Delivered-To: freebsd-net@freebsd.org Received: from gvr.gvr.org (gvr.gvr.org [212.61.40.17]) by hub.freebsd.org (Postfix) with ESMTP id 06C3C37B416 for ; Mon, 5 Nov 2001 05:43:35 -0800 (PST) Received: by gvr.gvr.org (Postfix, from userid 657) id 36C315808; Mon, 5 Nov 2001 14:43:30 +0100 (CET) Date: Mon, 5 Nov 2001 14:43:30 +0100 From: Guido van Rooij To: freebsd-net@freebsd.org Subject: patch regarding icmp bandwidth limiting Message-ID: <20011105144330.A29038@gvr.gvr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Does anyone mind the followning patch? The reason for it is that if I ping flood localhost I get the following messages: Limiting icmp ping response from 250 to 200 packets per second Limiting icmp ping response from 249 to 200 packets per second Limiting icmp ping response from 249 to 200 packets per second Limiting icmp ping response from 249 to 200 packets per second Limiting icmp ping response from 249 to 200 packets per second Limiting icmp ping response from 248 to 200 packets per second This doesn't make much sense because it seems that the limiting is trying to be set to 200 but somehow is stuck at 250. -Guido Index: ip_icmp.c =================================================================== RCS file: /scratch/cvsup/freebsd/CVS/src/sys/netinet/ip_icmp.c,v retrieving revision 1.62 diff -u -r1.62 ip_icmp.c --- ip_icmp.c 2001/10/25 05:56:30 1.62 +++ ip_icmp.c 2001/11/05 13:41:53 @@ -862,9 +862,10 @@ * bump packet count */ - if (++lpackets[which] > icmplim) { + if (lpackets[which] >= icmplim) { return(-1); } + lpackets[which]++; return(0); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message